Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'spec/requests')
-rw-r--r--spec/requests/api/graphql/mutations/issues/set_due_date_spec.rb2
-rw-r--r--spec/requests/api/graphql/mutations/merge_requests/update_spec.rb12
-rw-r--r--spec/requests/api/helm_packages_spec.rb6
-rw-r--r--spec/requests/api/projects_spec.rb18
4 files changed, 33 insertions, 5 deletions
diff --git a/spec/requests/api/graphql/mutations/issues/set_due_date_spec.rb b/spec/requests/api/graphql/mutations/issues/set_due_date_spec.rb
index 1a5a64e4196..ec71e44464a 100644
--- a/spec/requests/api/graphql/mutations/issues/set_due_date_spec.rb
+++ b/spec/requests/api/graphql/mutations/issues/set_due_date_spec.rb
@@ -68,7 +68,7 @@ RSpec.describe 'Setting Due Date of an issue', feature_category: :team_planning
it 'returns an error' do
post_graphql_mutation(mutation, current_user: current_user)
- expect(graphql_errors).to include(a_hash_including('message' => /Arguments must be provided: dueDate/))
+ expect(graphql_errors).to include(a_hash_including('message' => 'issueSetDueDate has the wrong arguments'))
end
end
diff --git a/spec/requests/api/graphql/mutations/merge_requests/update_spec.rb b/spec/requests/api/graphql/mutations/merge_requests/update_spec.rb
index 48db23569b6..3e2bdb376ad 100644
--- a/spec/requests/api/graphql/mutations/merge_requests/update_spec.rb
+++ b/spec/requests/api/graphql/mutations/merge_requests/update_spec.rb
@@ -28,5 +28,17 @@ RSpec.describe 'Update of an existing merge request', feature_category: :code_re
let(:resource) { merge_request }
let(:mutation_name) { 'mergeRequestUpdate' }
end
+
+ context 'when required arguments are missing' do
+ let(:input_params) { {} }
+
+ it_behaves_like 'a mutation that returns top-level errors' do
+ let(:match_errors) do
+ include(end_with(
+ 'invalid value for projectPath (Expected value to not be null), iid (Expected value to not be null)'
+ ))
+ end
+ end
+ end
end
end
diff --git a/spec/requests/api/helm_packages_spec.rb b/spec/requests/api/helm_packages_spec.rb
index d6afd6f86ff..75f60c59759 100644
--- a/spec/requests/api/helm_packages_spec.rb
+++ b/spec/requests/api/helm_packages_spec.rb
@@ -101,6 +101,12 @@ RSpec.describe API::HelmPackages, feature_category: :package_registry do
end
it_behaves_like 'deploy token for package GET requests'
+
+ context 'when format param is not nil' do
+ let(:url) { "/projects/#{project.id}/packages/helm/stable/charts/#{package.name}-#{package.version}.tgz.prov" }
+
+ it_behaves_like 'rejects helm packages access', :maintainer, :not_found, '{"message":"404 Format prov Not Found"}'
+ end
end
describe 'POST /api/v4/projects/:id/packages/helm/api/:channel/charts/authorize' do
diff --git a/spec/requests/api/projects_spec.rb b/spec/requests/api/projects_spec.rb
index c6e1605010e..ce90b9f1474 100644
--- a/spec/requests/api/projects_spec.rb
+++ b/spec/requests/api/projects_spec.rb
@@ -2783,10 +2783,20 @@ RSpec.describe API::Projects, :aggregate_failures, feature_category: :groups_and
expect(json_response['shared_with_groups'][0]['expires_at']).to eq(expires_at.to_s)
end
- it 'returns a project by path name' do
- get api(path, user)
- expect(response).to have_gitlab_http_status(:ok)
- expect(json_response['name']).to eq(project.name)
+ context 'when path name is specified' do
+ it 'returns a project' do
+ get api("/projects/#{CGI.escape(project.full_path)}", user)
+
+ expect(response).to have_gitlab_http_status(:ok)
+ expect(json_response['name']).to eq(project.name)
+ end
+
+ it 'returns a project using case-insensitive search' do
+ get api("/projects/#{CGI.escape(project.full_path.swapcase)}", user)
+
+ expect(response).to have_gitlab_http_status(:ok)
+ expect(json_response['name']).to eq(project.name)
+ end
end
context 'when a project is moved' do