]> git.openstreetmap.org Git - rails.git/blobdiff - test/unit/old_node_tag_test.rb
More tag validations, and finishing the node/way/relation tests.
[rails.git] / test / unit / old_node_tag_test.rb
index 4a9bcbfcb95fbb4ba52a92bd49b33c8ef012f7c7..4971843489a88853d9f534d671702f4455f1a7fd 100644 (file)
@@ -63,4 +63,16 @@ class OldNodeTest < Test::Unit::TestCase
     assert tag.errors.invalid?(:id)
     assert tag.errors.invalid?(:version)
   end
+  
+  def test_uniqueness
+    tag = OldNodeTag.new
+    tag.id = node_tags(:t1).id
+    tag.version = node_tags(:t1).version
+    tag.k = node_tags(:t1).k
+    tag.v = node_tags(:t1).v
+    assert tag.new_record?
+    assert !tag.valid?
+    assert_raise(ActiveRecord::RecordInvalid) {tag.save!}
+    assert tag.new_record?
+  end
 end