BigW Consortium Gitlab

Commit bb9c194c by Grzegorz Bizon

Respond 404 when unauthorized user imports members

parent c52b5c92
......@@ -100,7 +100,7 @@ class Projects::ProjectMembersController < Projects::ApplicationController
status = @project.team.import(source_project, current_user)
notice = status ? "Successfully imported" : "Import failed"
else
notice = 'Import failed - source project not found!'
return render_404
end
redirect_to(namespace_project_project_members_path(project.namespace, project),
......
......@@ -41,8 +41,8 @@ describe Projects::ProjectMembersController do
expect(project.team_members).to_not include member
end
it 'pretends that source projects does not exist' do
expect(response).to set_flash.to /source project not found/
it 'responds with not found' do
expect(response.status).to eq 404
end
end
end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment