Fixing some of the tests, adding the new tests to make sure that you can't edit when...
[rails.git] / test / unit / way_tag_test.rb
index fc1c8efa5277fa0f9c2afc3e9604d31855a3b594..018263da11624800c7fda66ee3dc58e558aa3be1 100644 (file)
@@ -1,8 +1,7 @@
 require File.dirname(__FILE__) + '/../test_helper'
 
 class WayTagTest < Test::Unit::TestCase
-  fixtures :current_way_tags
-  set_fixture_class :current_way_tags => WayTag
+  api_fixtures
   
   def test_way_tag_count
     assert_equal 3, WayTag.count
@@ -48,6 +47,7 @@ class WayTagTest < Test::Unit::TestCase
       tag.k = "k"
       tag.v = i
       assert !tag.valid?, "Value #{i} should be too long"
+      assert tag.errors.invalid?(:v)
     end
   end
   
@@ -57,7 +57,7 @@ class WayTagTest < Test::Unit::TestCase
     assert tag.errors.invalid?(:id)
   end
   
-  def test_uniquness
+  def test_uniqueness
     tag = WayTag.new
     tag.id = current_way_tags(:t1).id
     tag.k = current_way_tags(:t1).k