Fix bogus test class names
[rails.git] / test / unit / old_way_tag_test.rb
index 4945c14979392cf43092cac2983f4640f5f201e8..107111b1085f7e7b6525e1b09d4fce8a7e5ba40b 100644 (file)
@@ -1,17 +1,17 @@
 require File.dirname(__FILE__) + '/../test_helper'
 
-class WayTagTest < ActiveSupport::TestCase
+class OldWayTagTest < ActiveSupport::TestCase
   api_fixtures
   
   def test_tag_count
-    assert_equal 3, OldWayTag.count
+    assert_equal 7, OldWayTag.count
   end
   
   def test_length_key_valid
     key = "k"
     (0..255).each do |i|
       tag = OldWayTag.new
-      tag.id = way_tags(:t1).id
+      tag.way_id = way_tags(:t1).way_id
       tag.version = 1
       tag.k = key*i
       tag.v = "v"
@@ -23,7 +23,7 @@ class WayTagTest < ActiveSupport::TestCase
     val = "v"
     (0..255).each do |i|
       tag = OldWayTag.new
-      tag.id = way_tags(:t1).id
+      tag.way_id = way_tags(:t1).way_id
       tag.version = 1
       tag.k = "k"
       tag.v = val*i
@@ -34,36 +34,36 @@ class WayTagTest < ActiveSupport::TestCase
   def test_length_key_invalid
     ["k"*256].each do |i|
       tag = OldWayTag.new
-      tag.id = way_tags(:t1).id
+      tag.way_id = way_tags(:t1).way_id
       tag.version = 1
       tag.k = i
       tag.v = "v"
       assert !tag.valid?, "Key should be too long"
-      assert tag.errors.invalid?(:k)
+      assert tag.errors[:k].any?
     end
   end
   
   def test_length_value_invalid
     ["k"*256].each do |i|
       tag = OldWayTag.new
-      tag.id = way_tags(:t1).id
+      tag.way_id = way_tags(:t1).way_id
       tag.version = 1
       tag.k = "k"
       tag.v = i
       assert !tag.valid?, "Value should be too long"
-      assert tag.errors.invalid?(:v)
+      assert tag.errors[:v].any?
     end
   end
   
-  def test_empty_node_tag_invalid
-    tag = OldNodeTag.new
+  def test_empty_tag_invalid
+    tag = OldWayTag.new
     assert !tag.valid?, "Empty tag should be invalid"
-    assert tag.errors.invalid?(:id)
+    assert tag.errors[:old_way].any?
   end
   
   def test_uniqueness
     tag = OldWayTag.new
-    tag.id = way_tags(:t1).id
+    tag.way_id = way_tags(:t1).way_id
     tag.version = way_tags(:t1).version
     tag.k = way_tags(:t1).k
     tag.v = way_tags(:t1).v