diff options
author | Rafael França <rafaelmfranca@gmail.com> | 2016-10-10 21:38:59 -0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-10-10 21:38:59 -0300 |
commit | c2fa53606d3c98ac8dd079a1e5b22da3290a513b (patch) | |
tree | f6cb51b750c1ab0e725a4ecf41a5386af2b0bd8c /activemodel/test/cases/validations/length_validation_test.rb | |
parent | 36f6ab2d8e0ef84f520bb6169b61a8d79f222cfc (diff) | |
parent | 6a78e0ecd6122a6b1be9a95e6c4e21e10e429513 (diff) | |
download | rails-c2fa53606d3c98ac8dd079a1e5b22da3290a513b.tar.gz rails-c2fa53606d3c98ac8dd079a1e5b22da3290a513b.tar.bz2 rails-c2fa53606d3c98ac8dd079a1e5b22da3290a513b.zip |
Merge pull request #26755 from rafaelfranca/deprecations
Remove deprecations in Active Model, Action View and Active Job
Diffstat (limited to 'activemodel/test/cases/validations/length_validation_test.rb')
-rw-r--r-- | activemodel/test/cases/validations/length_validation_test.rb | 36 |
1 files changed, 0 insertions, 36 deletions
diff --git a/activemodel/test/cases/validations/length_validation_test.rb b/activemodel/test/cases/validations/length_validation_test.rb index ade185c179..62d9eaa346 100644 --- a/activemodel/test/cases/validations/length_validation_test.rb +++ b/activemodel/test/cases/validations/length_validation_test.rb @@ -318,42 +318,6 @@ class LengthValidationTest < ActiveModel::TestCase assert_equal ["is the wrong length (should be 5 characters)"], t.errors["title"] end - def test_validates_length_of_with_block - assert_deprecated do - Topic.validates_length_of( - :content, - minimum: 5, - too_short: "Your essay must be at least %{count} words.", - tokenizer: lambda { |str| str.scan(/\w+/) }, - ) - end - t = Topic.new(content: "this content should be long enough") - assert t.valid? - - t.content = "not long enough" - assert t.invalid? - assert t.errors[:content].any? - assert_equal ["Your essay must be at least 5 words."], t.errors[:content] - end - - def test_validates_length_of_with_symbol - assert_deprecated do - Topic.validates_length_of( - :content, - minimum: 5, - too_short: "Your essay must be at least %{count} words.", - tokenizer: :my_word_tokenizer, - ) - end - t = Topic.new(content: "this content should be long enough") - assert t.valid? - - t.content = "not long enough" - assert t.invalid? - assert t.errors[:content].any? - assert_equal ["Your essay must be at least 5 words."], t.errors[:content] - end - def test_validates_length_of_for_integer Topic.validates_length_of(:approved, is: 4) |