diff options
Diffstat (limited to 'activerecord/test')
-rw-r--r-- | activerecord/test/cases/scoping/relation_scoping_test.rb | 2 | ||||
-rw-r--r-- | activerecord/test/cases/validations_test.rb | 6 |
2 files changed, 3 insertions, 5 deletions
diff --git a/activerecord/test/cases/scoping/relation_scoping_test.rb b/activerecord/test/cases/scoping/relation_scoping_test.rb index 13007e2e73..a46123f451 100644 --- a/activerecord/test/cases/scoping/relation_scoping_test.rb +++ b/activerecord/test/cases/scoping/relation_scoping_test.rb @@ -246,7 +246,7 @@ class NestedRelationScopingTest < ActiveRecord::TestCase devs = Developer.all sql = devs.to_sql assert_match "(salary = 80000)", sql - assert_match /LIMIT 10|ROWNUM <= 10|FETCH FIRST 10 ROWS ONLY/, sql + assert_match(/LIMIT 10|ROWNUM <= 10|FETCH FIRST 10 ROWS ONLY/, sql) end end end diff --git a/activerecord/test/cases/validations_test.rb b/activerecord/test/cases/validations_test.rb index 76510cb80d..5d9aa99497 100644 --- a/activerecord/test/cases/validations_test.rb +++ b/activerecord/test/cases/validations_test.rb @@ -156,17 +156,15 @@ class ValidationsTest < ActiveRecord::TestCase end def test_numericality_validation_with_mutation - Topic.class_eval do + klass = Class.new(Topic) do attribute :wibble, :string validates_numericality_of :wibble, only_integer: true end - topic = Topic.new(wibble: "123-4567") + topic = klass.new(wibble: "123-4567") topic.wibble.gsub!("-", "") assert topic.valid? - ensure - Topic.reset_column_information end def test_acceptance_validator_doesnt_require_db_connection |