]> git.openstreetmap.org Git - rails.git/blobdiff - test/models/relation_tag_test.rb
Fix new rubocop warnings
[rails.git] / test / models / relation_tag_test.rb
index 02d6d95c705a6d2ca798372bdc1dff3ab05e42a5..4e9108a634da14576367a047c8d6e57536c1e989 100644 (file)
@@ -5,7 +5,7 @@ class RelationTagTest < ActiveSupport::TestCase
     tag = create(:relation_tag)
     [0, 255].each do |i|
       tag.k = "k" * i
-      assert tag.valid?
+      assert_predicate tag, :valid?
     end
   end
 
@@ -13,7 +13,7 @@ class RelationTagTest < ActiveSupport::TestCase
     tag = create(:relation_tag)
     [0, 255].each do |i|
       tag.v = "v" * i
-      assert tag.valid?
+      assert_predicate tag, :valid?
     end
   end
 
@@ -21,20 +21,20 @@ class RelationTagTest < ActiveSupport::TestCase
     tag = create(:relation_tag)
     tag.k = "k" * 256
     assert_not tag.valid?, "Key should be too long"
-    assert tag.errors[:k].any?
+    assert_predicate tag.errors[:k], :any?
   end
 
   def test_length_value_invalid
     tag = create(:relation_tag)
     tag.v = "v" * 256
     assert_not tag.valid?, "Value should be too long"
-    assert tag.errors[:v].any?
+    assert_predicate tag.errors[:v], :any?
   end
 
   def test_empty_tag_invalid
     tag = RelationTag.new
     assert_not tag.valid?, "Empty relation tag should be invalid"
-    assert tag.errors[:relation].any?
+    assert_predicate tag.errors[:relation], :any?
   end
 
   def test_uniqueness
@@ -43,10 +43,10 @@ class RelationTagTest < ActiveSupport::TestCase
     tag.relation_id = existing.relation_id
     tag.k = existing.k
     tag.v = existing.v
-    assert tag.new_record?
+    assert_predicate tag, :new_record?
     assert_not tag.valid?
     assert_raise(ActiveRecord::RecordInvalid) { tag.save! }
-    assert tag.new_record?
+    assert_predicate tag, :new_record?
   end
 
   ##