aboutsummaryrefslogtreecommitdiffstats
path: root/activemodel/test/cases/validations/exclusion_validation_test.rb
diff options
context:
space:
mode:
authorPatrick Robertson <patricksrobertson@gmail.com>2013-05-01 17:10:06 -0700
committerPatrick Robertson <patricksrobertson@gmail.com>2013-05-01 18:01:46 -0700
commiteebb9ddf9ba559a510975c486fe59a4edc9da97d (patch)
treef5e7fe3933183c796cf82d2bada32417eb0b65e8 /activemodel/test/cases/validations/exclusion_validation_test.rb
parentdd1f36078eff18721eed76d236796c8d26d81e58 (diff)
downloadrails-eebb9ddf9ba559a510975c486fe59a4edc9da97d.tar.gz
rails-eebb9ddf9ba559a510975c486fe59a4edc9da97d.tar.bz2
rails-eebb9ddf9ba559a510975c486fe59a4edc9da97d.zip
Convert ActiveModel to 1.9 hash syntax.
I also attempted to fix other styleguide violations such as { a: :b } over {a: :b} and foo(b: 'bar') over foo( b: 'bar' ).
Diffstat (limited to 'activemodel/test/cases/validations/exclusion_validation_test.rb')
-rw-r--r--activemodel/test/cases/validations/exclusion_validation_test.rb12
1 files changed, 6 insertions, 6 deletions
diff --git a/activemodel/test/cases/validations/exclusion_validation_test.rb b/activemodel/test/cases/validations/exclusion_validation_test.rb
index 7d5af27f3d..81455ba519 100644
--- a/activemodel/test/cases/validations/exclusion_validation_test.rb
+++ b/activemodel/test/cases/validations/exclusion_validation_test.rb
@@ -11,14 +11,14 @@ class ExclusionValidationTest < ActiveModel::TestCase
end
def test_validates_exclusion_of
- Topic.validates_exclusion_of( :title, :in => %w( abe monkey ) )
+ Topic.validates_exclusion_of(:title, in: %w( abe monkey ))
assert Topic.new("title" => "something", "content" => "abc").valid?
assert Topic.new("title" => "monkey", "content" => "abc").invalid?
end
def test_validates_exclusion_of_with_formatted_message
- Topic.validates_exclusion_of( :title, :in => %w( abe monkey ), :message => "option %{value} is restricted" )
+ Topic.validates_exclusion_of(:title, in: %w( abe monkey ), message: "option %{value} is restricted")
assert Topic.new("title" => "something", "content" => "abc")
@@ -29,7 +29,7 @@ class ExclusionValidationTest < ActiveModel::TestCase
end
def test_validates_exclusion_of_with_within_option
- Topic.validates_exclusion_of( :title, :within => %w( abe monkey ) )
+ Topic.validates_exclusion_of(:title, within: %w( abe monkey ))
assert Topic.new("title" => "something", "content" => "abc")
@@ -39,7 +39,7 @@ class ExclusionValidationTest < ActiveModel::TestCase
end
def test_validates_exclusion_of_for_ruby_class
- Person.validates_exclusion_of :karma, :in => %w( abe monkey )
+ Person.validates_exclusion_of :karma, in: %w( abe monkey )
p = Person.new
p.karma = "abe"
@@ -54,7 +54,7 @@ class ExclusionValidationTest < ActiveModel::TestCase
end
def test_validates_exclusion_of_with_lambda
- Topic.validates_exclusion_of :title, :in => lambda{ |topic| topic.author_name == "sikachu" ? %w( monkey elephant ) : %w( abe wasabi ) }
+ Topic.validates_exclusion_of :title, in: lambda { |topic| topic.author_name == "sikachu" ? %w( monkey elephant ) : %w( abe wasabi ) }
t = Topic.new
t.title = "elephant"
@@ -66,7 +66,7 @@ class ExclusionValidationTest < ActiveModel::TestCase
end
def test_validates_inclusion_of_with_symbol
- Person.validates_exclusion_of :karma, :in => :reserved_karmas
+ Person.validates_exclusion_of :karma, in: :reserved_karmas
p = Person.new
p.karma = "abe"