diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-10-31 15:11:01 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-10-31 15:11:01 +0300 |
commit | f52f8542b47c9e00ddf420abaf2263de168988f9 (patch) | |
tree | 568225882da5cc4deb746d2d4fc362c6076fb708 /spec/requests | |
parent | 6a5ef9b75d38f39cd2a6a2392fadfbd3b966b884 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/requests')
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 |