diff options
author | Stan Hu <stanhu@gmail.com> | 2018-02-26 13:45:57 -0800 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2018-02-26 14:13:32 -0800 |
commit | ad147bf736f17dce58f34b4547a48091078e53eb (patch) | |
tree | 39144a8e4ef5eadf3278e538b6cc7ffb3611407c | |
parent | cce53020b0c1c06aa9298294aaac01cb35d7c1fc (diff) | |
download | gitlab-ce-sh-fix-issue-43631.tar.gz |
Adjust the API issues move spec to use a non-hardcoded valuesh-fix-issue-43631
Closes #43631
-rw-r--r-- | spec/requests/api/v3/issues_spec.rb | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/spec/requests/api/v3/issues_spec.rb b/spec/requests/api/v3/issues_spec.rb index 0e745c82395..81f0ceb772c 100644 --- a/spec/requests/api/v3/issues_spec.rb +++ b/spec/requests/api/v3/issues_spec.rb @@ -1170,6 +1170,10 @@ describe API::V3::Issues do let!(:target_project) { create(:project, creator_id: user.id, namespace: user.namespace ) } let!(:target_project2) { create(:project, creator_id: non_member.id, namespace: non_member.namespace ) } + def non_existent_project_id + Project.maximum(:id).to_i + 10000 + end + it 'moves an issue' do post v3_api("/projects/#{project.id}/issues/#{issue.id}/move", user), to_project_id: target_project.id @@ -1218,7 +1222,7 @@ describe API::V3::Issues do context 'when source project does not exist' do it 'returns 404 when trying to move an issue' do - post v3_api("/projects/123/issues/#{issue.id}/move", user), + post v3_api("/projects/#{non_existent_project_id}/issues/#{issue.id}/move", user), to_project_id: target_project.id expect(response).to have_gitlab_http_status(404) @@ -1229,7 +1233,7 @@ describe API::V3::Issues do context 'when target project does not exist' do it 'returns 404 when trying to move an issue' do post v3_api("/projects/#{project.id}/issues/#{issue.id}/move", user), - to_project_id: 123 + to_project_id: non_existent_project_id expect(response).to have_gitlab_http_status(404) end |