0
@@ -605,7 +605,7 @@ class ValidationsTest < ActiveRecord::TestCase
0
def test_validate_format_with_formatted_message
0
- Topic.validates_format_of(:title, :with => /^Valid Title$/, :message => "can't be
%s")
0
+ Topic.validates_format_of(:title, :with => /^Valid Title$/, :message => "can't be
{{value}}")
0
t = Topic.create(:title => 'Invalid title')
0
assert_equal "can't be Invalid title", t.errors.on(:title)
0
@@ -666,7 +666,7 @@ class ValidationsTest < ActiveRecord::TestCase
0
def test_validates_inclusion_of_with_formatted_message
0
- Topic.validates_inclusion_of( :title, :in => %w( a b c d e f g ), :message => "option
%s is not in the list" )
0
+ Topic.validates_inclusion_of( :title, :in => %w( a b c d e f g ), :message => "option
{{value}} is not in the list" )
0
assert Topic.create("title" => "a", "content" => "abc").valid?
0
@@ -691,7 +691,7 @@ class ValidationsTest < ActiveRecord::TestCase
0
def test_validates_exclusion_of_with_formatted_message
0
- Topic.validates_exclusion_of( :title, :in => %w( abe monkey ), :message => "option
%s is restricted" )
0
+ Topic.validates_exclusion_of( :title, :in => %w( abe monkey ), :message => "option
{{value}} is restricted" )
0
assert Topic.create("title" => "something", "content" => "abc")
0
@@ -791,7 +791,7 @@ class ValidationsTest < ActiveRecord::TestCase
0
def test_optionally_validates_length_of_using_within_on_create
0
- Topic.validates_length_of :title, :content, :within => 5..10, :on => :create, :too_long => "my string is too long:
%d"
0
+ Topic.validates_length_of :title, :content, :within => 5..10, :on => :create, :too_long => "my string is too long:
{{count}}"
0
t = Topic.create("title" => "thisisnotvalid", "content" => "whatever")
0
@@ -812,7 +812,7 @@ class ValidationsTest < ActiveRecord::TestCase
0
def test_optionally_validates_length_of_using_within_on_update
0
- Topic.validates_length_of :title, :content, :within => 5..10, :on => :update, :too_short => "my string is too short:
%d"
0
+ Topic.validates_length_of :title, :content, :within => 5..10, :on => :update, :too_short => "my string is too short:
{{count}}"
0
t = Topic.create("title" => "vali", "content" => "whatever")
0
@@ -875,7 +875,7 @@ class ValidationsTest < ActiveRecord::TestCase
0
def test_validates_length_with_globally_modified_error_message
0
ActiveSupport::Deprecation.silence do
0
- ActiveRecord::Errors.default_error_messages[:too_short] = 'tu est trops petit hombre
%d'
0
+ ActiveRecord::Errors.default_error_messages[:too_short] = 'tu est trops petit hombre
{{count}}'
0
Topic.validates_length_of :title, :minimum => 10
0
t = Topic.create(:title => 'too short')
0
@@ -919,7 +919,7 @@ class ValidationsTest < ActiveRecord::TestCase
0
def test_validates_length_of_custom_errors_for_minimum_with_message
0
- Topic.validates_length_of( :title, :minimum=>5, :message=>"boo
%d" )
0
+ Topic.validates_length_of( :title, :minimum=>5, :message=>"boo
{{count}}" )
0
t = Topic.create("title" => "uhoh", "content" => "whatever")
0
assert t.errors.on(:title)
0
@@ -927,7 +927,7 @@ class ValidationsTest < ActiveRecord::TestCase
0
def test_validates_length_of_custom_errors_for_minimum_with_too_short
0
- Topic.validates_length_of( :title, :minimum=>5, :too_short=>"hoo
%d" )
0
+ Topic.validates_length_of( :title, :minimum=>5, :too_short=>"hoo
{{count}}" )
0
t = Topic.create("title" => "uhoh", "content" => "whatever")
0
assert t.errors.on(:title)
0
@@ -935,7 +935,7 @@ class ValidationsTest < ActiveRecord::TestCase
0
def test_validates_length_of_custom_errors_for_maximum_with_message
0
- Topic.validates_length_of( :title, :maximum=>5, :message=>"boo
%d" )
0
+ Topic.validates_length_of( :title, :maximum=>5, :message=>"boo
{{count}}" )
0
t = Topic.create("title" => "uhohuhoh", "content" => "whatever")
0
assert t.errors.on(:title)
0
@@ -943,7 +943,7 @@ class ValidationsTest < ActiveRecord::TestCase
0
def test_validates_length_of_custom_errors_for_maximum_with_too_long
0
- Topic.validates_length_of( :title, :maximum=>5, :too_long=>"hoo
%d" )
0
+ Topic.validates_length_of( :title, :maximum=>5, :too_long=>"hoo
{{count}}" )
0
t = Topic.create("title" => "uhohuhoh", "content" => "whatever")
0
assert t.errors.on(:title)
0
@@ -951,7 +951,7 @@ class ValidationsTest < ActiveRecord::TestCase
0
def test_validates_length_of_custom_errors_for_is_with_message
0
- Topic.validates_length_of( :title, :is=>5, :message=>"boo
%d" )
0
+ Topic.validates_length_of( :title, :is=>5, :message=>"boo
{{count}}" )
0
t = Topic.create("title" => "uhohuhoh", "content" => "whatever")
0
assert t.errors.on(:title)
0
@@ -959,7 +959,7 @@ class ValidationsTest < ActiveRecord::TestCase
0
def test_validates_length_of_custom_errors_for_is_with_wrong_length
0
- Topic.validates_length_of( :title, :is=>5, :wrong_length=>"hoo
%d" )
0
+ Topic.validates_length_of( :title, :is=>5, :wrong_length=>"hoo
{{count}}" )
0
t = Topic.create("title" => "uhohuhoh", "content" => "whatever")
0
assert t.errors.on(:title)
0
@@ -1025,7 +1025,7 @@ class ValidationsTest < ActiveRecord::TestCase
0
def test_optionally_validates_length_of_using_within_on_create_utf8
0
- Topic.validates_length_of :title, :within => 5..10, :on => :create, :too_long => "長すぎます:
%d"
0
+ Topic.validates_length_of :title, :within => 5..10, :on => :create, :too_long => "長すぎます:
{{count}}"
0
t = Topic.create("title" => "一二三四五六七八九十A", "content" => "whatever")
0
@@ -1048,7 +1048,7 @@ class ValidationsTest < ActiveRecord::TestCase
0
def test_optionally_validates_length_of_using_within_on_update_utf8
0
- Topic.validates_length_of :title, :within => 5..10, :on => :update, :too_short => "短すぎます:
%d"
0
+ Topic.validates_length_of :title, :within => 5..10, :on => :update, :too_short => "短すぎます:
{{count}}"
0
t = Topic.create("title" => "一二三4", "content" => "whatever")
0
@@ -1083,7 +1083,7 @@ class ValidationsTest < ActiveRecord::TestCase
0
def test_validates_length_of_with_block
0
- Topic.validates_length_of :content, :minimum => 5, :too_short=>"Your essay must be at least
%d words.", 0
+ Topic.validates_length_of :content, :minimum => 5, :too_short=>"Your essay must be at least
{{count}} words.",0
:tokenizer => lambda {|str| str.scan(/\w+/) }
0
t = Topic.create!(:content => "this content should be long enough")
0
@@ -1234,7 +1234,7 @@ class ValidationsTest < ActiveRecord::TestCase
0
def test_if_validation_using_method_true
0
# When the method returns true
0
- Topic.validates_length_of( :title, :maximum=>5, :too_long=>"hoo
%d", :if => :condition_is_true )
0
+ Topic.validates_length_of( :title, :maximum=>5, :too_long=>"hoo
{{count}}", :if => :condition_is_true )
0
t = Topic.create("title" => "uhohuhoh", "content" => "whatever")
0
assert t.errors.on(:title)
0
@@ -1243,7 +1243,7 @@ class ValidationsTest < ActiveRecord::TestCase
0
def test_unless_validation_using_method_true
0
# When the method returns true
0
- Topic.validates_length_of( :title, :maximum=>5, :too_long=>"hoo
%d", :unless => :condition_is_true )
0
+ Topic.validates_length_of( :title, :maximum=>5, :too_long=>"hoo
{{count}}", :unless => :condition_is_true )
0
t = Topic.create("title" => "uhohuhoh", "content" => "whatever")
0
assert !t.errors.on(:title)
0
@@ -1251,7 +1251,7 @@ class ValidationsTest < ActiveRecord::TestCase
0
def test_if_validation_using_method_false
0
# When the method returns false
0
- Topic.validates_length_of( :title, :maximum=>5, :too_long=>"hoo
%d", :if => :condition_is_true_but_its_not )
0
+ Topic.validates_length_of( :title, :maximum=>5, :too_long=>"hoo
{{count}}", :if => :condition_is_true_but_its_not )
0
t = Topic.create("title" => "uhohuhoh", "content" => "whatever")
0
assert !t.errors.on(:title)
0
@@ -1259,7 +1259,7 @@ class ValidationsTest < ActiveRecord::TestCase
0
def test_unless_validation_using_method_false
0
# When the method returns false
0
- Topic.validates_length_of( :title, :maximum=>5, :too_long=>"hoo
%d", :unless => :condition_is_true_but_its_not )
0
+ Topic.validates_length_of( :title, :maximum=>5, :too_long=>"hoo
{{count}}", :unless => :condition_is_true_but_its_not )
0
t = Topic.create("title" => "uhohuhoh", "content" => "whatever")
0
assert t.errors.on(:title)
0
@@ -1268,7 +1268,7 @@ class ValidationsTest < ActiveRecord::TestCase
0
def test_if_validation_using_string_true
0
# When the evaluated string returns true
0
- Topic.validates_length_of( :title, :maximum=>5, :too_long=>"hoo
%d", :if => "a = 1; a == 1" )
0
+ Topic.validates_length_of( :title, :maximum=>5, :too_long=>"hoo
{{count}}", :if => "a = 1; a == 1" )
0
t = Topic.create("title" => "uhohuhoh", "content" => "whatever")
0
assert t.errors.on(:title)
0
@@ -1277,7 +1277,7 @@ class ValidationsTest < ActiveRecord::TestCase
0
def test_unless_validation_using_string_true
0
# When the evaluated string returns true
0
- Topic.validates_length_of( :title, :maximum=>5, :too_long=>"hoo
%d", :unless => "a = 1; a == 1" )
0
+ Topic.validates_length_of( :title, :maximum=>5, :too_long=>"hoo
{{count}}", :unless => "a = 1; a == 1" )
0
t = Topic.create("title" => "uhohuhoh", "content" => "whatever")
0
assert !t.errors.on(:title)
0
@@ -1285,7 +1285,7 @@ class ValidationsTest < ActiveRecord::TestCase
0
def test_if_validation_using_string_false
0
# When the evaluated string returns false
0
- Topic.validates_length_of( :title, :maximum=>5, :too_long=>"hoo
%d", :if => "false")
0
+ Topic.validates_length_of( :title, :maximum=>5, :too_long=>"hoo
{{count}}", :if => "false")
0
t = Topic.create("title" => "uhohuhoh", "content" => "whatever")
0
assert !t.errors.on(:title)
0
@@ -1293,7 +1293,7 @@ class ValidationsTest < ActiveRecord::TestCase
0
def test_unless_validation_using_string_false
0
# When the evaluated string returns false
0
- Topic.validates_length_of( :title, :maximum=>5, :too_long=>"hoo
%d", :unless => "false")
0
+ Topic.validates_length_of( :title, :maximum=>5, :too_long=>"hoo
{{count}}", :unless => "false")
0
t = Topic.create("title" => "uhohuhoh", "content" => "whatever")
0
assert t.errors.on(:title)
0
@@ -1302,7 +1302,7 @@ class ValidationsTest < ActiveRecord::TestCase
0
def test_if_validation_using_block_true
0
# When the block returns true
0
- Topic.validates_length_of( :title, :maximum=>5, :too_long=>"hoo
%d",
0
+ Topic.validates_length_of( :title, :maximum=>5, :too_long=>"hoo
{{count}}",
0
:if => Proc.new { |r| r.content.size > 4 } )
0
t = Topic.create("title" => "uhohuhoh", "content" => "whatever")
0
@@ -1312,7 +1312,7 @@ class ValidationsTest < ActiveRecord::TestCase
0
def test_unless_validation_using_block_true
0
# When the block returns true
0
- Topic.validates_length_of( :title, :maximum=>5, :too_long=>"hoo
%d",
0
+ Topic.validates_length_of( :title, :maximum=>5, :too_long=>"hoo
{{count}}",
0
:unless => Proc.new { |r| r.content.size > 4 } )
0
t = Topic.create("title" => "uhohuhoh", "content" => "whatever")
0
@@ -1321,7 +1321,7 @@ class ValidationsTest < ActiveRecord::TestCase
0
def test_if_validation_using_block_false
0
# When the block returns false
0
- Topic.validates_length_of( :title, :maximum=>5, :too_long=>"hoo
%d",
0
+ Topic.validates_length_of( :title, :maximum=>5, :too_long=>"hoo
{{count}}",
0
:if => Proc.new { |r| r.title != "uhohuhoh"} )
0
t = Topic.create("title" => "uhohuhoh", "content" => "whatever")
0
@@ -1330,7 +1330,7 @@ class ValidationsTest < ActiveRecord::TestCase
0
def test_unless_validation_using_block_false
0
# When the block returns false
0
- Topic.validates_length_of( :title, :maximum=>5, :too_long=>"hoo
%d",
0
+ Topic.validates_length_of( :title, :maximum=>5, :too_long=>"hoo
{{count}}",
0
:unless => Proc.new { |r| r.title != "uhohuhoh"} )
0
t = Topic.create("title" => "uhohuhoh", "content" => "whatever")
0
@@ -1507,13 +1507,13 @@ class ValidatesNumericalityTest < ActiveRecord::TestCase
0
def test_validates_numericality_with_numeric_message
0
- Topic.validates_numericality_of :approved, :less_than => 4, :message => "smaller than
%d"
0
+ Topic.validates_numericality_of :approved, :less_than => 4, :message => "smaller than
{{count}}"
0
topic = Topic.new("title" => "numeric test", "approved" => 10)
0
assert_equal "smaller than 4", topic.errors.on(:approved)
0
- Topic.validates_numericality_of :approved, :greater_than => 4, :message => "greater than
%d"
0
+ Topic.validates_numericality_of :approved, :greater_than => 4, :message => "greater than
{{count}}"
0
topic = Topic.new("title" => "numeric test", "approved" => 1)