-
Notifications
You must be signed in to change notification settings - Fork 21.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ReflectionTest#test_read_attribute_names got failure, an extra "wibble" shown #26099
Comments
https://github.com/rails/rails/blob/master/activerecord/test/cases/validations_test.rb#L158-L170 def test_numericality_validation_with_mutation
Topic.class_eval do
attribute :wibble, :string
validates_numericality_of :wibble, only_integer: true
end
topic = Topic.new(wibble: "123-4567")
topic.wibble.gsub!("-", "")
assert topic.valid?
ensure
Topic.reset_column_information
end |
How about it? def test_numericality_validation_with_mutation
klass = Class.new(Topic) do
attribute :wibble, :string
validates_numericality_of :wibble, only_integer: true
end
topic = klass.new(wibble: "123-4567")
topic.wibble.gsub!("-", "")
assert topic.valid?
end |
(Sorry pointing another guy since I did not confirm autocomplete) If I understand correctly (correct me if I'm wrong and if you have some time) Let me open a pull request. Thanks again. |
since it affects another test `ReflectionTest#test_read_attribute_names` Address rails#26099
Opened #26124 |
Closed as #26124 has been merged to master. |
Steps to reproduce
Expected behavior
All ActiveRecord unit test should finish without failures
Actual behavior
All sqlite3, mysql2 and postgresql adapters get the same failure:
System configuration
Rails version: master branch
Ruby version:ruby 2.3.1p112 (2016-04-26 revision 54768) [x86_64-linux]
Additional information
ruby 2.3.1 has been installed by
rbenv
andruby-build
plugin.According to
git bisect
these failure reproduces sincef0ddf87
The text was updated successfully, but these errors were encountered: