X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/dc2a2c8ebd1a11e4a64555fda22c6859a51defff..fe4d50588d8173060a0055662c1e4b1304c17808:/test/controllers/relation_controller_test.rb diff --git a/test/controllers/relation_controller_test.rb b/test/controllers/relation_controller_test.rb index 347c0d121..bb9286f1d 100644 --- a/test/controllers/relation_controller_test.rb +++ b/test/controllers/relation_controller_test.rb @@ -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 + # FIXME: check whether this contains the stuff we want! end ## @@ -172,7 +177,7 @@ class RelationControllerTest < ActionController::TestCase # need a role attribute to be included nid = current_nodes(:used_node_1).id content "" + - "" + "" + "" + "" put :create # hope for forbidden due to user assert_response :forbidden, @@ -260,7 +265,7 @@ class RelationControllerTest < ActionController::TestCase # need a role attribute to be included nid = current_nodes(:used_node_1).id content "" + - "" + "" + "" + "" put :create # hope for success assert_response :success, @@ -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. # -------------------------------------