X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/51c5be98f7c10e077d22488434365a626da5a893..35be1120925e43b6c2aaf470a13aebae25cddb51:/test/controllers/relation_controller_test.rb diff --git a/test/controllers/relation_controller_test.rb b/test/controllers/relation_controller_test.rb index 7e10159b4..6b9ed159f 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 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. # -------------------------------------