]> git.openstreetmap.org Git - rails.git/blobdiff - test/controllers/relation_controller_test.rb
Yet more tests...
[rails.git] / test / controllers / relation_controller_test.rb
index 7e10159b4d416f450af60368b5ccf5cf5a49574f..6b9ed159faee6134dec8f7e1bf3eb6d616c26055 100644 (file)
@@ -105,10 +105,15 @@ class RelationControllerTest < ActionController::TestCase
 
   def test_full
     # check the "full" mode
+    get :full, :id => 999999
+    assert_response :not_found
+
+    get :full, :id => current_relations(:invisible_relation).id
+    assert_response :gone
+
     get :full, :id => current_relations(:visible_relation).id
     assert_response :success
     # FIXME: check whether this contains the stuff we want!
-    print @response.body if $VERBOSE
   end
 
   ##
@@ -382,6 +387,19 @@ class RelationControllerTest < ActionController::TestCase
     end
   end
 
+  def test_update_wrong_id
+    basic_authorization users(:public_user).email, "test"
+    rel_id = current_relations(:multi_tag_relation).id
+    cs_id = changesets(:public_user_first_change).id
+
+    with_relation(rel_id) do |rel|
+      update_changeset(rel, cs_id)
+      content rel
+      put :update, :id => current_relations(:visible_relation).id
+      assert_response :bad_request
+    end
+  end
+
   # -------------------------------------
   # Test creating some invalid relations.
   # -------------------------------------