]> git.openstreetmap.org Git - rails.git/blobdiff - test/models/changeset_tag_test.rb
Use assert_not_predicate in tests that have assert_predicate
[rails.git] / test / models / changeset_tag_test.rb
index 5832b8a706523674aeb96cc6ca21d8e770a9dcc8..81b280790d3b428cc9bb15afa3a64eacb5e77a09 100644 (file)
@@ -20,21 +20,21 @@ class ChangesetTagTest < ActiveSupport::TestCase
   def test_length_key_invalid
     tag = create(:changeset_tag)
     tag.k = "k" * 256
-    assert_not tag.valid?, "Key should be too long"
+    assert_not_predicate tag, :valid?, "Key should be too long"
     assert_predicate tag.errors[:k], :any?
   end
 
   def test_length_value_invalid
     tag = create(:changeset_tag)
     tag.v = "v" * 256
-    assert_not tag.valid?, "Value should be too long"
+    assert_not_predicate tag, :valid?, "Value should be too long"
     assert_predicate tag.errors[:v], :any?
   end
 
   def test_orphaned_tag_invalid
     tag = create(:changeset_tag)
     tag.changeset = nil
-    assert_not tag.valid?, "Orphaned tag should be invalid"
+    assert_not_predicate tag, :valid?, "Orphaned tag should be invalid"
     assert_predicate tag.errors[:changeset], :any?
   end
 
@@ -42,7 +42,7 @@ class ChangesetTagTest < ActiveSupport::TestCase
     existing = create(:changeset_tag)
     tag = build(:changeset_tag, :changeset => existing.changeset, :k => existing.k, :v => existing.v)
     assert_predicate tag, :new_record?
-    assert_not tag.valid?
+    assert_not_predicate tag, :valid?
     assert_raise(ActiveRecord::RecordInvalid) { tag.save! }
     assert_predicate tag, :new_record?
   end