diff options
Diffstat (limited to 'spec/requests/api/issue_links_spec.rb')
-rw-r--r-- | spec/requests/api/issue_links_spec.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/spec/requests/api/issue_links_spec.rb b/spec/requests/api/issue_links_spec.rb index 40d8f6d2395..fcb199a91a4 100644 --- a/spec/requests/api/issue_links_spec.rb +++ b/spec/requests/api/issue_links_spec.rb @@ -87,7 +87,7 @@ RSpec.describe API::IssueLinks, feature_category: :team_planning do end context 'when user does not have write access to given issue' do - it 'returns 404' do + it 'returns 403' do unauthorized_project = create(:project) target_issue = create(:issue, project: unauthorized_project) unauthorized_project.add_guest(user) @@ -95,8 +95,8 @@ RSpec.describe API::IssueLinks, feature_category: :team_planning do post api("/projects/#{project.id}/issues/#{issue.iid}/links", user), params: { target_project_id: unauthorized_project.id, target_issue_iid: target_issue.iid } - expect(response).to have_gitlab_http_status(:not_found) - expect(json_response['message']).to eq('No matching issue found. Make sure that you are adding a valid issue URL.') + expect(response).to have_gitlab_http_status(:forbidden) + expect(json_response['message']).to eq("Couldn't link issue. You must have at least the Reporter role in both projects.") end end |