]> git.openstreetmap.org Git - rails.git/blobdiff - test/functional/node_controller_test.rb
better handling of duplicate tags. Extra validation in the tests.
[rails.git] / test / functional / node_controller_test.rb
index dbc00cbb2471e1918a525d3c7b5f8b1000740c47..9d7f48ca42e52a032413f5d8b27071d6e1d553b1 100644 (file)
@@ -1,18 +1,9 @@
 require File.dirname(__FILE__) + '/../test_helper'
 require 'node_controller'
 
-# Re-raise errors caught by the controller.
-class NodeController; def rescue_action(e) raise e end; end
-
-class NodeControllerTest < Test::Unit::TestCase
+class NodeControllerTest < ActionController::TestCase
   api_fixtures
 
-  def setup
-    @controller = NodeController.new
-    @request    = ActionController::TestRequest.new
-    @response   = ActionController::TestResponse.new
-  end
-
   def test_create
     # cannot read password from fixture as it is stored as MD5 digest
     basic_authorization(users(:normal_user).email, "test");
@@ -203,7 +194,8 @@ class NodeControllerTest < Test::Unit::TestCase
     content node_xml
     put :update, :id => current_nodes(:visible_node).id
     assert_response :bad_request, 
-       "adding duplicate tags to a node should fail with 'bad request'"
+      "adding duplicate tags to a node should fail with 'bad request'"
+    assert_equal "Element node/#{current_nodes(:visible_node).id} has duplicate tags with key #{current_node_tags(:t1).k}.", @response.body
   end
 
   # test whether string injection is possible