Permalink
Browse files

Better naming convention for the test conditions

  • Loading branch information...
1 parent fb1fdac commit cf912c21303374d2ee7335c443ec8194d0ae9cfe @bcardarella bcardarella committed Oct 28, 2011
Showing with 24 additions and 24 deletions.
  1. +24 −24 test/action_view/cases/test_helpers.rb
@@ -360,20 +360,20 @@ def test_conditional_validators_should_be_filtered
:cost => {
:presence => {
:message => "can't be blank",
- :unless => :cannot_validate?
+ :unless => :do_not_validate?
}
},
:title => {
:presence => {
:message => "can't be blank",
- :if => :can_validate?
+ :if => :do_validate?
}
}
}
@post.title = nil
- @post.stubs(:cannot_validate?).returns(false)
- @post.stubs(:can_validate?).returns(true)
+ @post.stubs(:do_not_validate?).returns(false)
+ @post.stubs(:do_validate?).returns(true)
@post.stubs(:client_side_validation_hash).returns(hash)
form_for(@post, :validate => true) do |f|
concat f.text_field(:cost)
@@ -393,20 +393,20 @@ def test_conditional_validator_filters_being_forced
:cost => {
:presence => {
:message => "can't be blank",
- :unless => :cannot_validate?
+ :unless => :do_not_validate?
}
},
:title => {
:presence => {
:message => "can't be blank",
- :if => :can_validate?
+ :if => :do_validate?
}
}
}
@post.title = nil
- @post.stubs(:cannot_validate?).returns(false)
- @post.stubs(:can_validate?).returns(true)
+ @post.stubs(:do_not_validate?).returns(false)
+ @post.stubs(:do_validate?).returns(true)
@post.stubs(:client_side_validation_hash).returns(hash)
form_for(@post, :validate => true) do |f|
concat f.text_field(:cost, :validate => true)
@@ -429,20 +429,20 @@ def test_conditional_validator_filters_being_forced_and_not_meeting_condition
:cost => {
:presence => {
:message => "can't be blank",
- :unless => :cannot_validate?
+ :unless => :do_not_validate?
}
},
:title => {
:presence => {
:message => "can't be blank",
- :if => :can_validate?
+ :if => :do_validate?
}
}
}
@post.title = nil
- @post.stubs(:cannot_validate?).returns(true)
- @post.stubs(:can_validate?).returns(false)
+ @post.stubs(:do_not_validate?).returns(true)
+ @post.stubs(:do_validate?).returns(false)
@post.stubs(:client_side_validation_hash).returns(hash)
form_for(@post, :validate => true) do |f|
concat f.text_field(:cost, :validate => true)
@@ -462,20 +462,20 @@ def test_conditional_validator_filters_being_forced_individually
:cost => {
:presence => {
:message => "can't be blank",
- :unless => :cannot_validate?
+ :unless => :do_not_validate?
}
},
:title => {
:presence => {
:message => "can't be blank",
- :if => :can_validate?
+ :if => :do_validate?
}
}
}
@post.title = nil
- @post.stubs(:cannot_validate?).returns(false)
- @post.stubs(:can_validate?).returns(true)
+ @post.stubs(:do_not_validate?).returns(false)
+ @post.stubs(:do_validate?).returns(true)
@post.stubs(:client_side_validation_hash).returns(hash)
form_for(@post, :validate => true) do |f|
concat f.text_field(:cost, :validate => { :presence => true })
@@ -498,20 +498,20 @@ def test_conditional_validator_filters_being_forced_and_not_meeting_condition_in
:cost => {
:presence => {
:message => "can't be blank",
- :unless => :cannot_validate?
+ :unless => :do_not_validate?
}
},
:title => {
:presence => {
:message => "can't be blank",
- :if => :can_validate?
+ :if => :do_validate?
}
}
}
@post.title = nil
- @post.stubs(:cannot_validate?).returns(true)
- @post.stubs(:can_validate?).returns(false)
+ @post.stubs(:do_not_validate?).returns(true)
+ @post.stubs(:do_validate?).returns(false)
@post.stubs(:client_side_validation_hash).returns(hash)
form_for(@post, :validate => true) do |f|
concat f.text_field(:cost, :validate => { :presence => true })
@@ -531,20 +531,20 @@ def test_conditional_validator_filters_being_forced_with_procs
:cost => {
:presence => {
:message => "can't be blank",
- :unless => Proc.new { |post| post.cannot_validate? }
+ :unless => Proc.new { |post| post.do_not_validate? }
}
},
:title => {
:presence => {
:message => "can't be blank",
- :if => Proc.new { |post| post.can_validate? }
+ :if => Proc.new { |post| post.do_validate? }
}
}
}
@post.title = nil
- @post.stubs(:cannot_validate?).returns(false)
- @post.stubs(:can_validate?).returns(true)
+ @post.stubs(:do_not_validate?).returns(false)
+ @post.stubs(:do_validate?).returns(true)
@post.stubs(:client_side_validation_hash).returns(hash)
form_for(@post, :validate => true) do |f|
concat f.text_field(:cost, :validate => true)

0 comments on commit cf912c2

Please sign in to comment.