]> git.openstreetmap.org Git - rails.git/blobdiff - test/models/way_tag_test.rb
Remove Geonames and geocoder.ca
[rails.git] / test / models / way_tag_test.rb
index cb225947c48ca554d8c78e0aa01c0359e1322d7a..64aacc63b532660bb7278721addc0f8c9fc6001b 100644 (file)
@@ -31,15 +31,16 @@ class WayTagTest < ActiveSupport::TestCase
     assert_predicate tag.errors[:v], :any?
   end
 
-  def test_empty_tag_invalid
-    tag = WayTag.new
-    assert_not tag.valid?, "Empty way tag should be invalid"
+  def test_orphaned_tag_invalid
+    tag = create(:way_tag)
+    tag.way = nil
+    assert_not tag.valid?, "Orphaned tag should be invalid"
     assert_predicate tag.errors[:way], :any?
   end
 
   def test_uniqueness
     existing = create(:way_tag)
-    tag = WayTag.new
+    tag = build(:way_tag, :way => existing.way, :k => existing.k, :v => existing.v)
     tag.way_id = existing.way_id
     tag.k = existing.k
     tag.v = existing.v