diff options
author | Patrick Robertson <patricksrobertson@gmail.com> | 2013-05-01 17:10:06 -0700 |
---|---|---|
committer | Patrick Robertson <patricksrobertson@gmail.com> | 2013-05-01 18:01:46 -0700 |
commit | eebb9ddf9ba559a510975c486fe59a4edc9da97d (patch) | |
tree | f5e7fe3933183c796cf82d2bada32417eb0b65e8 /activemodel/test/cases/validations/validations_context_test.rb | |
parent | dd1f36078eff18721eed76d236796c8d26d81e58 (diff) | |
download | rails-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/validations_context_test.rb')
-rw-r--r-- | activemodel/test/cases/validations/validations_context_test.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/activemodel/test/cases/validations/validations_context_test.rb b/activemodel/test/cases/validations/validations_context_test.rb index b795861f95..5f99b320a6 100644 --- a/activemodel/test/cases/validations/validations_context_test.rb +++ b/activemodel/test/cases/validations/validations_context_test.rb @@ -19,21 +19,21 @@ class ValidationsContextTest < ActiveModel::TestCase end test "with a class that adds errors on create and validating a new model with no arguments" do - Topic.validates_with(ValidatorThatAddsErrors, :on => :create) + Topic.validates_with(ValidatorThatAddsErrors, on: :create) topic = Topic.new assert topic.valid?, "Validation doesn't run on valid? if 'on' is set to create" end test "with a class that adds errors on update and validating a new model" do - Topic.validates_with(ValidatorThatAddsErrors, :on => :update) + Topic.validates_with(ValidatorThatAddsErrors, on: :update) topic = Topic.new assert topic.valid?(:create), "Validation doesn't run on create if 'on' is set to update" end test "with a class that adds errors on create and validating a new model" do - Topic.validates_with(ValidatorThatAddsErrors, :on => :create) + Topic.validates_with(ValidatorThatAddsErrors, on: :create) topic = Topic.new assert topic.invalid?(:create), "Validation does run on create if 'on' is set to create" assert topic.errors[:base].include?(ERROR_MESSAGE) end -end
\ No newline at end of file +end |