diff options
Diffstat (limited to 'activemodel/test/cases/validations/format_validation_test.rb')
-rw-r--r-- | activemodel/test/cases/validations/format_validation_test.rb | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/activemodel/test/cases/validations/format_validation_test.rb b/activemodel/test/cases/validations/format_validation_test.rb index 86bbbe6ebe..d7e6bf3707 100644 --- a/activemodel/test/cases/validations/format_validation_test.rb +++ b/activemodel/test/cases/validations/format_validation_test.rb @@ -1,10 +1,9 @@ -require 'cases/helper' +require "cases/helper" -require 'models/topic' -require 'models/person' +require "models/topic" +require "models/person" class PresenceValidationTest < ActiveModel::TestCase - def teardown Topic.clear_validators! end @@ -63,7 +62,7 @@ class PresenceValidationTest < ActiveModel::TestCase def test_validate_format_with_formatted_message Topic.validates_format_of(:title, with: /\AValid Title\z/, message: "can't be %{value}") - t = Topic.new(title: 'Invalid title') + t = Topic.new(title: "Invalid title") assert t.invalid? assert_equal ["can't be Invalid title"], t.errors[:title] end @@ -73,7 +72,7 @@ class PresenceValidationTest < ActiveModel::TestCase end def test_validate_format_of_with_multiline_regexp_and_option - assert_nothing_raised(ArgumentError) do + assert_nothing_raised do Topic.validates_format_of(:title, with: /^Valid Title$/, multiline: true) end end |