summaryrefslogtreecommitdiff
path: root/spec/requests
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-04-01 15:07:45 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-04-01 15:07:45 +0000
commit1219a9dce91f4edbc135dfc08299b4122b4825a8 (patch)
treee7d12a55d75a2d56e60d9527bef3724e3578866d /spec/requests
parent1a0d6dbdc2ac3047f4953a359ef27ba6e26074ae (diff)
downloadgitlab-ce-1219a9dce91f4edbc135dfc08299b4122b4825a8.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/requests')
-rw-r--r--spec/requests/api/award_emoji_spec.rb8
-rw-r--r--spec/requests/api/environments_spec.rb8
-rw-r--r--spec/requests/api/group_container_repositories_spec.rb2
-rw-r--r--spec/requests/api/group_import_spec.rb2
-rw-r--r--spec/requests/api/group_labels_spec.rb4
-rw-r--r--spec/requests/api/import_github_spec.rb4
-rw-r--r--spec/requests/api/internal/base_spec.rb6
-rw-r--r--spec/requests/api/issues/get_project_issues_spec.rb2
-rw-r--r--spec/requests/api/issues/issues_spec.rb2
-rw-r--r--spec/requests/api/issues/post_projects_issues_spec.rb2
-rw-r--r--spec/requests/api/issues/put_projects_issues_spec.rb2
-rw-r--r--spec/requests/api/labels_spec.rb4
-rw-r--r--spec/requests/api/members_spec.rb8
-rw-r--r--spec/requests/api/merge_request_diffs_spec.rb2
-rw-r--r--spec/requests/api/merge_requests_spec.rb10
-rw-r--r--spec/requests/api/pipelines_spec.rb4
-rw-r--r--spec/requests/api/project_events_spec.rb2
-rw-r--r--spec/requests/api/project_hooks_spec.rb4
-rw-r--r--spec/requests/api/project_snippets_spec.rb8
-rw-r--r--spec/requests/api/projects_spec.rb12
-rw-r--r--spec/requests/api/repositories_spec.rb4
-rw-r--r--spec/requests/api/snippets_spec.rb4
-rw-r--r--spec/requests/api/system_hooks_spec.rb2
23 files changed, 53 insertions, 53 deletions
diff --git a/spec/requests/api/award_emoji_spec.rb b/spec/requests/api/award_emoji_spec.rb
index fea1e3ac836..543fe970abd 100644
--- a/spec/requests/api/award_emoji_spec.rb
+++ b/spec/requests/api/award_emoji_spec.rb
@@ -26,7 +26,7 @@ describe API::AwardEmoji do
end
it "returns a 404 error when issue id not found" do
- get api("/projects/#{project.id}/issues/12345/award_emoji", user)
+ get api("/projects/#{project.id}/issues/#{non_existing_record_iid}/award_emoji", user)
expect(response).to have_gitlab_http_status(:not_found)
end
@@ -91,7 +91,7 @@ describe API::AwardEmoji do
end
it "returns a 404 error if the award is not found" do
- get api("/projects/#{project.id}/issues/#{issue.iid}/award_emoji/12345", user)
+ get api("/projects/#{project.id}/issues/#{issue.iid}/award_emoji/#{non_existing_record_id}", user)
expect(response).to have_gitlab_http_status(:not_found)
end
@@ -255,7 +255,7 @@ describe API::AwardEmoji do
end
it 'returns a 404 error when the award emoji can not be found' do
- delete api("/projects/#{project.id}/issues/#{issue.iid}/award_emoji/12345", user)
+ delete api("/projects/#{project.id}/issues/#{issue.iid}/award_emoji/#{non_existing_record_id}", user)
expect(response).to have_gitlab_http_status(:not_found)
end
@@ -275,7 +275,7 @@ describe API::AwardEmoji do
end
it 'returns a 404 error when note id not found' do
- delete api("/projects/#{project.id}/merge_requests/#{merge_request.iid}/notes/12345", user)
+ delete api("/projects/#{project.id}/merge_requests/#{merge_request.iid}/notes/#{non_existing_record_id}", user)
expect(response).to have_gitlab_http_status(:not_found)
end
diff --git a/spec/requests/api/environments_spec.rb b/spec/requests/api/environments_spec.rb
index 4e2dfe7725e..91b3dd93433 100644
--- a/spec/requests/api/environments_spec.rb
+++ b/spec/requests/api/environments_spec.rb
@@ -127,7 +127,7 @@ describe API::Environments do
end
it 'returns a 400 when the required params are missing' do
- post api("/projects/12345/environments", non_member), params: { external_url: 'http://env.git.com' }
+ post api("/projects/#{non_existing_record_id}/environments", non_member), params: { external_url: 'http://env.git.com' }
end
end
end
@@ -163,7 +163,7 @@ describe API::Environments do
end
it 'returns a 404 if the environment does not exist' do
- put api("/projects/#{project.id}/environments/12345", user)
+ put api("/projects/#{project.id}/environments/#{non_existing_record_id}", user)
expect(response).to have_gitlab_http_status(:not_found)
end
@@ -186,7 +186,7 @@ describe API::Environments do
end
it 'returns a 404 for non existing id' do
- delete api("/projects/#{project.id}/environments/12345", user)
+ delete api("/projects/#{project.id}/environments/#{non_existing_record_id}", user)
expect(response).to have_gitlab_http_status(:not_found)
expect(json_response['message']).to eq('404 Not found')
@@ -229,7 +229,7 @@ describe API::Environments do
end
it 'returns a 404 for non existing id' do
- post api("/projects/#{project.id}/environments/12345/stop", user)
+ post api("/projects/#{project.id}/environments/#{non_existing_record_id}/stop", user)
expect(response).to have_gitlab_http_status(:not_found)
expect(json_response['message']).to eq('404 Not found')
diff --git a/spec/requests/api/group_container_repositories_spec.rb b/spec/requests/api/group_container_repositories_spec.rb
index 785006253d8..9f439bb2167 100644
--- a/spec/requests/api/group_container_repositories_spec.rb
+++ b/spec/requests/api/group_container_repositories_spec.rb
@@ -47,7 +47,7 @@ describe API::GroupContainerRepositories do
it_behaves_like 'a gitlab tracking event', described_class.name, 'list_repositories'
context 'with invalid group id' do
- let(:url) { '/groups/123412341234/registry/repositories' }
+ let(:url) { "/groups/#{non_existing_record_id}/registry/repositories" }
it 'returns not found' do
subject
diff --git a/spec/requests/api/group_import_spec.rb b/spec/requests/api/group_import_spec.rb
index 3f85428aac2..58bff08dcbb 100644
--- a/spec/requests/api/group_import_spec.rb
+++ b/spec/requests/api/group_import_spec.rb
@@ -97,7 +97,7 @@ describe API::GroupImport do
context 'when parent group is invalid' do
it 'returns 404 and does not create new group' do
- params[:parent_id] = 99999
+ params[:parent_id] = non_existing_record_id
expect { subject }.not_to change { Group.count }
diff --git a/spec/requests/api/group_labels_spec.rb b/spec/requests/api/group_labels_spec.rb
index 231a055f73c..715c1255cb3 100644
--- a/spec/requests/api/group_labels_spec.rb
+++ b/spec/requests/api/group_labels_spec.rb
@@ -334,7 +334,7 @@ describe API::GroupLabels do
context 'when label ID is not found' do
it 'returns 404 error' do
- post api("/groups/#{group.id}/labels/1234/subscribe", user)
+ post api("/groups/#{group.id}/labels/#{non_existing_record_id}/subscribe", user)
expect(response).to have_gitlab_http_status(:not_found)
end
@@ -380,7 +380,7 @@ describe API::GroupLabels do
context 'when label ID is not found' do
it 'returns 404 error' do
- post api("/groups/#{group.id}/labels/1234/unsubscribe", user)
+ post api("/groups/#{group.id}/labels/#{non_existing_record_id}/unsubscribe", user)
expect(response).to have_gitlab_http_status(:not_found)
end
diff --git a/spec/requests/api/import_github_spec.rb b/spec/requests/api/import_github_spec.rb
index 1a7d3b18d11..ecdb02beeb0 100644
--- a/spec/requests/api/import_github_spec.rb
+++ b/spec/requests/api/import_github_spec.rb
@@ -34,7 +34,7 @@ describe API::ImportGithub do
post api("/import/github", user), params: {
target_namespace: user.namespace_path,
personal_access_token: token,
- repo_id: 1234
+ repo_id: non_existing_record_id
}
expect(response).to have_gitlab_http_status(:created)
expect(json_response).to be_a Hash
@@ -47,7 +47,7 @@ describe API::ImportGithub do
post api("/import/github", user), params: {
target_namespace: other_namespace.name,
personal_access_token: token,
- repo_id: 1234
+ repo_id: non_existing_record_id
}
expect(response).to have_gitlab_http_status(:unprocessable_entity)
diff --git a/spec/requests/api/internal/base_spec.rb b/spec/requests/api/internal/base_spec.rb
index 06ba0bd30ff..575d695ef54 100644
--- a/spec/requests/api/internal/base_spec.rb
+++ b/spec/requests/api/internal/base_spec.rb
@@ -53,7 +53,7 @@ describe API::Internal::Base do
post api('/internal/two_factor_recovery_codes'),
params: {
secret_token: secret_token,
- key_id: 12345
+ key_id: non_existing_record_id
}
expect(json_response['success']).to be_falsey
@@ -152,13 +152,13 @@ describe API::Internal::Base do
end
it 'returns a 404 when the wrong key is provided' do
- lfs_auth_key(key.id + 12345, project)
+ lfs_auth_key(non_existing_record_id, project)
expect(response).to have_gitlab_http_status(:not_found)
end
it 'returns a 404 when the wrong user is provided' do
- lfs_auth_user(user.id + 12345, project)
+ lfs_auth_user(non_existing_record_id, project)
expect(response).to have_gitlab_http_status(:not_found)
end
diff --git a/spec/requests/api/issues/get_project_issues_spec.rb b/spec/requests/api/issues/get_project_issues_spec.rb
index 1e6a1d2ed20..4a728c81215 100644
--- a/spec/requests/api/issues/get_project_issues_spec.rb
+++ b/spec/requests/api/issues/get_project_issues_spec.rb
@@ -78,7 +78,7 @@ describe API::Issues do
description: "closes #{issue.to_reference(private_mrs_project)}")
end
- before(:all) do
+ before_all do
project.add_reporter(user)
project.add_guest(guest)
private_mrs_project.add_reporter(user)
diff --git a/spec/requests/api/issues/issues_spec.rb b/spec/requests/api/issues/issues_spec.rb
index d9496d6646f..00169c1529f 100644
--- a/spec/requests/api/issues/issues_spec.rb
+++ b/spec/requests/api/issues/issues_spec.rb
@@ -61,7 +61,7 @@ describe API::Issues do
let(:no_milestone_title) { 'None' }
let(:any_milestone_title) { 'Any' }
- before(:all) do
+ before_all do
project.add_reporter(user)
project.add_guest(guest)
private_mrs_project.add_reporter(user)
diff --git a/spec/requests/api/issues/post_projects_issues_spec.rb b/spec/requests/api/issues/post_projects_issues_spec.rb
index 5b8d45d9465..be48113c215 100644
--- a/spec/requests/api/issues/post_projects_issues_spec.rb
+++ b/spec/requests/api/issues/post_projects_issues_spec.rb
@@ -60,7 +60,7 @@ describe API::Issues do
let(:no_milestone_title) { 'None' }
let(:any_milestone_title) { 'Any' }
- before(:all) do
+ before_all do
project.add_reporter(user)
project.add_guest(guest)
end
diff --git a/spec/requests/api/issues/put_projects_issues_spec.rb b/spec/requests/api/issues/put_projects_issues_spec.rb
index 51037f701e1..ffc5e2b1db8 100644
--- a/spec/requests/api/issues/put_projects_issues_spec.rb
+++ b/spec/requests/api/issues/put_projects_issues_spec.rb
@@ -61,7 +61,7 @@ describe API::Issues do
let(:no_milestone_title) { 'None' }
let(:any_milestone_title) { 'Any' }
- before(:all) do
+ before_all do
project.add_reporter(user)
project.add_guest(guest)
end
diff --git a/spec/requests/api/labels_spec.rb b/spec/requests/api/labels_spec.rb
index 19d4e8cef20..1f17359a473 100644
--- a/spec/requests/api/labels_spec.rb
+++ b/spec/requests/api/labels_spec.rb
@@ -596,7 +596,7 @@ describe API::Labels do
context "when label ID is not found" do
it "returns 404 error" do
- post api("/projects/#{project.id}/labels/1234/subscribe", user)
+ post api("/projects/#{project.id}/labels/#{non_existing_record_id}/subscribe", user)
expect(response).to have_gitlab_http_status(:not_found)
end
@@ -642,7 +642,7 @@ describe API::Labels do
context "when label ID is not found" do
it "returns 404 error" do
- post api("/projects/#{project.id}/labels/1234/unsubscribe", user)
+ post api("/projects/#{project.id}/labels/#{non_existing_record_id}/unsubscribe", user)
expect(response).to have_gitlab_http_status(:not_found)
end
diff --git a/spec/requests/api/members_spec.rb b/spec/requests/api/members_spec.rb
index 0b504df1f51..0ecef26c27a 100644
--- a/spec/requests/api/members_spec.rb
+++ b/spec/requests/api/members_spec.rb
@@ -314,9 +314,9 @@ describe API::Members do
expect(response).to have_gitlab_http_status(:bad_request)
end
- it 'returns 400 when access_level is not valid' do
+ it 'returns 400 when access_level is not valid' do
post api("/#{source_type.pluralize}/#{source.id}/members", maintainer),
- params: { user_id: stranger.id, access_level: 1234 }
+ params: { user_id: stranger.id, access_level: non_existing_record_access_level }
expect(response).to have_gitlab_http_status(:bad_request)
end
@@ -371,9 +371,9 @@ describe API::Members do
expect(response).to have_gitlab_http_status(:bad_request)
end
- it 'returns 400 when access level is not valid' do
+ it 'returns 400 when access level is not valid' do
put api("/#{source_type.pluralize}/#{source.id}/members/#{developer.id}", maintainer),
- params: { access_level: 1234 }
+ params: { access_level: non_existing_record_access_level }
expect(response).to have_gitlab_http_status(:bad_request)
end
diff --git a/spec/requests/api/merge_request_diffs_spec.rb b/spec/requests/api/merge_request_diffs_spec.rb
index 90b6f39cc90..d00bc4a6dde 100644
--- a/spec/requests/api/merge_request_diffs_spec.rb
+++ b/spec/requests/api/merge_request_diffs_spec.rb
@@ -60,7 +60,7 @@ describe API::MergeRequestDiffs, 'MergeRequestDiffs' do
end
it 'returns a 404 when merge_request_iid is not found' do
- get api("/projects/#{project.id}/merge_requests/12345/versions/#{merge_request_diff.id}", user)
+ get api("/projects/#{project.id}/merge_requests/#{non_existing_record_iid}/versions/#{merge_request_diff.id}", user)
expect(response).to have_gitlab_http_status(:not_found)
end
end
diff --git a/spec/requests/api/merge_requests_spec.rb b/spec/requests/api/merge_requests_spec.rb
index 403e182ad99..a8543c8e282 100644
--- a/spec/requests/api/merge_requests_spec.rb
+++ b/spec/requests/api/merge_requests_spec.rb
@@ -1720,7 +1720,7 @@ describe API::MergeRequests do
end
it "returns 404 for an invalid merge request IID" do
- delete api("/projects/#{project.id}/merge_requests/12345", user)
+ delete api("/projects/#{project.id}/merge_requests/#{non_existing_record_iid}", user)
expect(response).to have_gitlab_http_status(:not_found)
end
@@ -1931,7 +1931,7 @@ describe API::MergeRequests do
end
it "returns 404 for an invalid merge request IID" do
- put api("/projects/#{project.id}/merge_requests/12345/merge", user)
+ put api("/projects/#{project.id}/merge_requests/#{non_existing_record_iid}/merge", user)
expect(response).to have_gitlab_http_status(:not_found)
end
@@ -2053,7 +2053,7 @@ describe API::MergeRequests do
end
context 'when invalid merge request IID' do
- let(:merge_request_iid) { '12345' }
+ let(:merge_request_iid) { non_existing_record_iid }
it 'returns 404' do
get api(url, user)
@@ -2301,7 +2301,7 @@ describe API::MergeRequests do
end
it "returns 404 for an invalid merge request IID" do
- put api("/projects/#{project.id}/merge_requests/12345", user), params: { state_event: "close" }
+ put api("/projects/#{project.id}/merge_requests/#{non_existing_record_iid}", user), params: { state_event: "close" }
expect(response).to have_gitlab_http_status(:not_found)
end
@@ -2366,7 +2366,7 @@ describe API::MergeRequests do
end
it "returns 404 for an invalid merge request IID" do
- get api("/projects/#{project.id}/merge_requests/12345/closes_issues", user)
+ get api("/projects/#{project.id}/merge_requests/#{non_existing_record_iid}/closes_issues", user)
expect(response).to have_gitlab_http_status(:not_found)
end
diff --git a/spec/requests/api/pipelines_spec.rb b/spec/requests/api/pipelines_spec.rb
index 6b824690e6c..a8f21f64a72 100644
--- a/spec/requests/api/pipelines_spec.rb
+++ b/spec/requests/api/pipelines_spec.rb
@@ -442,7 +442,7 @@ describe API::Pipelines do
end
it 'returns 404 when it does not exist' do
- get api("/projects/#{project.id}/pipelines/123456", user)
+ get api("/projects/#{project.id}/pipelines/#{non_existing_record_id}", user)
expect(response).to have_gitlab_http_status(:not_found)
expect(json_response['message']).to eq '404 Not found'
@@ -599,7 +599,7 @@ describe API::Pipelines do
end
it 'returns 404 when it does not exist' do
- delete api("/projects/#{project.id}/pipelines/123456", owner)
+ delete api("/projects/#{project.id}/pipelines/#{non_existing_record_id}", owner)
expect(response).to have_gitlab_http_status(:not_found)
expect(json_response['message']).to eq '404 Not found'
diff --git a/spec/requests/api/project_events_spec.rb b/spec/requests/api/project_events_spec.rb
index 3fa3d4fa899..489b83de434 100644
--- a/spec/requests/api/project_events_spec.rb
+++ b/spec/requests/api/project_events_spec.rb
@@ -107,7 +107,7 @@ describe API::ProjectEvents do
end
it 'returns 404 if project does not exist' do
- get api("/projects/1234/events", user)
+ get api("/projects/#{non_existing_record_id}/events", user)
expect(response).to have_gitlab_http_status(:not_found)
end
diff --git a/spec/requests/api/project_hooks_spec.rb b/spec/requests/api/project_hooks_spec.rb
index 540b30e2969..4474f2f0577 100644
--- a/spec/requests/api/project_hooks_spec.rb
+++ b/spec/requests/api/project_hooks_spec.rb
@@ -75,7 +75,7 @@ describe API::ProjectHooks, 'ProjectHooks' do
end
it "returns a 404 error if hook id is not available" do
- get api("/projects/#{project.id}/hooks/1234", user)
+ get api("/projects/#{project.id}/hooks/#{non_existing_record_id}", user)
expect(response).to have_gitlab_http_status(:not_found)
end
@@ -180,7 +180,7 @@ describe API::ProjectHooks, 'ProjectHooks' do
end
it "returns 404 error if hook id not found" do
- put api("/projects/#{project.id}/hooks/1234", user), params: { url: 'http://example.org' }
+ put api("/projects/#{project.id}/hooks/#{non_existing_record_id}", user), params: { url: 'http://example.org' }
expect(response).to have_gitlab_http_status(:not_found)
end
diff --git a/spec/requests/api/project_snippets_spec.rb b/spec/requests/api/project_snippets_spec.rb
index 1af5d553bf0..89ade15c1f6 100644
--- a/spec/requests/api/project_snippets_spec.rb
+++ b/spec/requests/api/project_snippets_spec.rb
@@ -110,7 +110,7 @@ describe API::ProjectSnippets do
end
it 'returns 404 for invalid snippet id' do
- get api("/projects/#{project.id}/snippets/1234", user)
+ get api("/projects/#{project.id}/snippets/#{non_existing_record_id}", user)
expect(response).to have_gitlab_http_status(:not_found)
expect(json_response['message']).to eq('404 Not found')
@@ -349,7 +349,7 @@ describe API::ProjectSnippets do
end
it 'returns 404 for invalid snippet id' do
- update_snippet(snippet_id: '1234', params: { title: 'foo' })
+ update_snippet(snippet_id: non_existing_record_id, params: { title: 'foo' })
expect(response).to have_gitlab_http_status(:not_found)
expect(json_response['message']).to eq('404 Snippet Not Found')
@@ -442,7 +442,7 @@ describe API::ProjectSnippets do
end
it 'returns 404 for invalid snippet id' do
- delete api("/projects/#{snippet.project.id}/snippets/1234", admin)
+ delete api("/projects/#{snippet.project.id}/snippets/#{non_existing_record_id}", admin)
expect(response).to have_gitlab_http_status(:not_found)
expect(json_response['message']).to eq('404 Snippet Not Found')
@@ -471,7 +471,7 @@ describe API::ProjectSnippets do
end
it 'returns 404 for invalid snippet id' do
- get api("/projects/#{snippet.project.id}/snippets/1234/raw", admin)
+ get api("/projects/#{snippet.project.id}/snippets/#{non_existing_record_id}/raw", admin)
expect(response).to have_gitlab_http_status(:not_found)
expect(json_response['message']).to eq('404 Snippet Not Found')
diff --git a/spec/requests/api/projects_spec.rb b/spec/requests/api/projects_spec.rb
index a50b2b7aca8..190afb9cda5 100644
--- a/spec/requests/api/projects_spec.rb
+++ b/spec/requests/api/projects_spec.rb
@@ -1101,7 +1101,7 @@ describe API::Projects do
end
it 'returns error when user not found' do
- get api('/users/9999/starred_projects/')
+ get api("/users/#{non_existing_record_id}/starred_projects/")
expect(response).to have_gitlab_http_status(:not_found)
expect(json_response['message']).to eq('404 User Not Found')
@@ -2088,13 +2088,13 @@ describe API::Projects do
end
it 'returns a 404 error when group does not exist' do
- post api("/projects/#{project.id}/share", user), params: { group_id: 1234, group_access: Gitlab::Access::DEVELOPER }
+ post api("/projects/#{project.id}/share", user), params: { group_id: non_existing_record_id, group_access: Gitlab::Access::DEVELOPER }
expect(response).to have_gitlab_http_status(:not_found)
end
it "returns a 400 error when wrong params passed" do
- post api("/projects/#{project.id}/share", user), params: { group_id: group.id, group_access: 1234 }
+ post api("/projects/#{project.id}/share", user), params: { group_id: group.id, group_access: non_existing_record_access_level }
expect(response).to have_gitlab_http_status(:bad_request)
expect(json_response['error']).to eq 'group_access does not have a valid value'
@@ -2137,13 +2137,13 @@ describe API::Projects do
end
it 'returns a 404 error when group link does not exist' do
- delete api("/projects/#{project.id}/share/1234", user)
+ delete api("/projects/#{project.id}/share/#{non_existing_record_id}", user)
expect(response).to have_gitlab_http_status(:not_found)
end
it 'returns a 404 error when project does not exist' do
- delete api("/projects/123/share/1234", user)
+ delete api("/projects/123/share/#{non_existing_record_id}", user)
expect(response).to have_gitlab_http_status(:not_found)
end
@@ -2634,7 +2634,7 @@ describe API::Projects do
end
it 'returns not_found(404) for not existing project' do
- get api("/projects/9999999999/starrers", user)
+ get api("/projects/#{non_existing_record_id}/starrers", user)
expect(response).to have_gitlab_http_status(:not_found)
end
diff --git a/spec/requests/api/repositories_spec.rb b/spec/requests/api/repositories_spec.rb
index a96bc68ace9..0c66bfd6c4d 100644
--- a/spec/requests/api/repositories_spec.rb
+++ b/spec/requests/api/repositories_spec.rb
@@ -117,7 +117,7 @@ describe API::Repositories do
context 'when sha does not exist' do
it_behaves_like '404 response' do
- let(:request) { get api(route.sub(sample_blob.oid, '123456'), current_user) }
+ let(:request) { get api(route.sub(sample_blob.oid, 'abcd9876'), current_user) }
let(:message) { '404 Blob Not Found' }
end
end
@@ -179,7 +179,7 @@ describe API::Repositories do
context 'when sha does not exist' do
it_behaves_like '404 response' do
- let(:request) { get api(route.sub(sample_blob.oid, '123456'), current_user) }
+ let(:request) { get api(route.sub(sample_blob.oid, 'abcd9876'), current_user) }
let(:message) { '404 Blob Not Found' }
end
end
diff --git a/spec/requests/api/snippets_spec.rb b/spec/requests/api/snippets_spec.rb
index caa9d9251d8..3e30dc537e4 100644
--- a/spec/requests/api/snippets_spec.rb
+++ b/spec/requests/api/snippets_spec.rb
@@ -354,7 +354,7 @@ describe API::Snippets do
it_behaves_like 'snippet updates'
it 'returns 404 for invalid snippet id' do
- update_snippet(snippet_id: '1234', params: { title: 'Foo' })
+ update_snippet(snippet_id: non_existing_record_id, params: { title: 'Foo' })
expect(response).to have_gitlab_http_status(:not_found)
expect(json_response['message']).to eq('404 Snippet Not Found')
@@ -441,7 +441,7 @@ describe API::Snippets do
end
it 'returns 404 for invalid snippet id' do
- delete api("/snippets/1234", user)
+ delete api("/snippets/#{non_existing_record_id}", user)
expect(response).to have_gitlab_http_status(:not_found)
expect(json_response['message']).to eq('404 Snippet Not Found')
diff --git a/spec/requests/api/system_hooks_spec.rb b/spec/requests/api/system_hooks_spec.rb
index 50015d2e2c3..609aa615d33 100644
--- a/spec/requests/api/system_hooks_spec.rb
+++ b/spec/requests/api/system_hooks_spec.rb
@@ -126,7 +126,7 @@ describe API::SystemHooks do
end
it 'returns 404 if the system hook does not exist' do
- delete api('/hooks/12345', admin)
+ delete api("/hooks/#{non_existing_record_id}", admin)
expect(response).to have_gitlab_http_status(:not_found)
end