Created
November 19, 2013 16:04
-
-
Save hegyi/7547694 to your computer and use it in GitHub Desktop.
I've created a custom test file only with the two problematic test cases. Without column reset it fails with the error below. As far as I can tell the first test case doesn't do anything destructive. Any idea?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "cases/helper" | |
require 'models/default' | |
require 'models/entrant' | |
class CustomTest < ActiveRecord::TestCase | |
# FROM defaults_test.rb | |
def test_default_integers | |
default = Default.new | |
assert_instance_of Fixnum, default.positive_integer | |
assert_equal 1, default.positive_integer | |
assert_instance_of Fixnum, default.negative_integer | |
assert_equal(-1, default.negative_integer) | |
assert_instance_of BigDecimal, default.decimal_number | |
assert_equal BigDecimal.new("2.78"), default.decimal_number | |
# Fix? | |
# Default.reset_column_information | |
end | |
# FROM cases/base_test.rb test_default method | |
def test_xdefault | |
with_timezone_config default: :local do | |
default = Default.new | |
# fixed dates / times | |
assert_equal Date.new(2004, 1, 1), default.fixed_date | |
assert_equal Time.local(2004, 1,1,0,0,0,0), default.fixed_time | |
# char types | |
assert_equal 'Y', default.char1 | |
assert_equal 'a varchar field', default.char2 | |
assert_equal 'a text field', default.char3 | |
end | |
end | |
end | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CustomTest#test_xdefault [test/cases/custom.rb:28]: | |
Expected: 2004-01-01 00:00:00 +0100 | |
Actual: 2004-01-01 00:00:00 UTC |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment