diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-07-29 21:08:58 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-07-29 21:08:58 +0300 |
commit | a16398e10f87edd229a12be2f1fc87cd4a76f902 (patch) | |
tree | c3f4db5dbf36a8470689cab3ad3bfe55aced5f1d /spec/requests/api | |
parent | 8c2d06cba79ff8965a4de9467e05e80d7c7f449e (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/requests/api')
52 files changed, 108 insertions, 108 deletions
diff --git a/spec/requests/api/boards_spec.rb b/spec/requests/api/boards_spec.rb index feb11f2ffef..817e1324c7c 100644 --- a/spec/requests/api/boards_spec.rb +++ b/spec/requests/api/boards_spec.rb @@ -61,7 +61,7 @@ RSpec.describe API::Boards do delete api(url, user) expect(response).to have_gitlab_http_status(:no_content) - end.to change {board_parent.boards.count}.by(-1) + end.to change { board_parent.boards.count }.by(-1) end end diff --git a/spec/requests/api/branches_spec.rb b/spec/requests/api/branches_spec.rb index 780e45cf443..e3d69d6b66a 100644 --- a/spec/requests/api/branches_spec.rb +++ b/spec/requests/api/branches_spec.rb @@ -201,7 +201,7 @@ RSpec.describe API::Branches do context 'when sort value is not supported' do it_behaves_like '400 response' do - let(:request) { get api(route, user), params: { sort: 'unknown' }} + let(:request) { get api(route, user), params: { sort: 'unknown' } } end end end diff --git a/spec/requests/api/ci/jobs_spec.rb b/spec/requests/api/ci/jobs_spec.rb index 84ef9f8db1b..57828e50320 100644 --- a/spec/requests/api/ci/jobs_spec.rb +++ b/spec/requests/api/ci/jobs_spec.rb @@ -158,7 +158,7 @@ RSpec.describe API::Ci::Jobs do context 'with basic auth header' do let(:personal_access_token) { create(:personal_access_token, user: user) } - let(:token) { personal_access_token.token} + let(:token) { personal_access_token.token } include_context 'with auth headers' do let(:header) { { Gitlab::Auth::AuthFinders::PRIVATE_TOKEN_HEADER => token } } diff --git a/spec/requests/api/ci/runner/jobs_request_post_spec.rb b/spec/requests/api/ci/runner/jobs_request_post_spec.rb index 746be1ccc44..cd58251cfcc 100644 --- a/spec/requests/api/ci/runner/jobs_request_post_spec.rb +++ b/spec/requests/api/ci/runner/jobs_request_post_spec.rb @@ -29,7 +29,7 @@ RSpec.describe API::Ci::Runner, :clean_gitlab_redis_shared_state do describe 'POST /api/v4/jobs/request' do let!(:last_update) {} - let!(:new_update) { } + let!(:new_update) {} let(:user_agent) { 'gitlab-runner 9.0.0 (9-0-stable; go1.7.4; linux/amd64)' } before do diff --git a/spec/requests/api/ci/runner/jobs_trace_spec.rb b/spec/requests/api/ci/runner/jobs_trace_spec.rb index c3c074d80d9..d42043a7fe5 100644 --- a/spec/requests/api/ci/runner/jobs_trace_spec.rb +++ b/spec/requests/api/ci/runner/jobs_trace_spec.rb @@ -61,7 +61,7 @@ RSpec.describe API::Ci::Runner, :clean_gitlab_redis_trace_chunks do end context 'when job has been updated recently' do - it { expect { patch_the_trace }.not_to change { job.updated_at }} + it { expect { patch_the_trace }.not_to change { job.updated_at } } it "changes the job's trace" do patch_the_trace @@ -70,7 +70,7 @@ RSpec.describe API::Ci::Runner, :clean_gitlab_redis_trace_chunks do end context 'when Runner makes a force-patch' do - it { expect { force_patch_the_trace }.not_to change { job.updated_at }} + it { expect { force_patch_the_trace }.not_to change { job.updated_at } } it "doesn't change the build.trace" do force_patch_the_trace diff --git a/spec/requests/api/ci/secure_files_spec.rb b/spec/requests/api/ci/secure_files_spec.rb index 6f16fe5460b..f1f22dfadc2 100644 --- a/spec/requests/api/ci/secure_files_spec.rb +++ b/spec/requests/api/ci/secure_files_spec.rb @@ -59,7 +59,7 @@ RSpec.describe API::Ci::SecureFiles do expect do post api("/projects/#{project.id}/secure_files", maintainer), params: file_params - end.not_to change {project.secure_files.count} + end.not_to change { project.secure_files.count } expect(response).to have_gitlab_http_status(:service_unavailable) end @@ -78,7 +78,7 @@ RSpec.describe API::Ci::SecureFiles do it 'returns a 201 when uploading a file when the ci_secure_files_read_only feature flag is disabled' do expect do post api("/projects/#{project.id}/secure_files", maintainer), params: file_params - end.to change {project.secure_files.count}.by(1) + end.to change { project.secure_files.count }.by(1) expect(response).to have_gitlab_http_status(:created) end @@ -249,7 +249,7 @@ RSpec.describe API::Ci::SecureFiles do it 'creates a secure file' do expect do post api("/projects/#{project.id}/secure_files", maintainer), params: file_params - end.to change {project.secure_files.count}.by(1) + end.to change { project.secure_files.count }.by(1) expect(response).to have_gitlab_http_status(:created) expect(json_response['name']).to eq('upload-keystore.jks') diff --git a/spec/requests/api/ci/triggers_spec.rb b/spec/requests/api/ci/triggers_spec.rb index a036a55f5f3..953dcb8a483 100644 --- a/spec/requests/api/ci/triggers_spec.rb +++ b/spec/requests/api/ci/triggers_spec.rb @@ -136,8 +136,8 @@ RSpec.describe API::Ci::Triggers do end context 'when triggered from another running job' do - let!(:trigger) { } - let!(:trigger_request) { } + let!(:trigger) {} + let!(:trigger_request) {} context 'when other job is triggered by a user' do let(:trigger_token) { create(:ci_build, :running, project: project, user: user).token } @@ -242,7 +242,7 @@ RSpec.describe API::Ci::Triggers do expect do post api("/projects/#{project.id}/triggers", user), params: { description: 'trigger' } - end.to change {project.triggers.count}.by(1) + end.to change { project.triggers.count }.by(1) expect(response).to have_gitlab_http_status(:created) expect(json_response).to include('description' => 'trigger') @@ -335,7 +335,7 @@ RSpec.describe API::Ci::Triggers do delete api("/projects/#{project.id}/triggers/#{trigger.id}", user) expect(response).to have_gitlab_http_status(:no_content) - end.to change {project.triggers.count}.by(-1) + end.to change { project.triggers.count }.by(-1) end it 'responds with 404 Not Found if requesting non-existing trigger' do diff --git a/spec/requests/api/ci/variables_spec.rb b/spec/requests/api/ci/variables_spec.rb index dc524e121d5..74ed8c1551d 100644 --- a/spec/requests/api/ci/variables_spec.rb +++ b/spec/requests/api/ci/variables_spec.rb @@ -116,7 +116,7 @@ RSpec.describe API::Ci::Variables do it 'creates variable' do expect do post api("/projects/#{project.id}/variables", user), params: { key: 'TEST_VARIABLE_2', value: 'PROTECTED_VALUE_2', protected: true, masked: true } - end.to change {project.variables.count}.by(1) + end.to change { project.variables.count }.by(1) expect(response).to have_gitlab_http_status(:created) expect(json_response['key']).to eq('TEST_VARIABLE_2') @@ -129,7 +129,7 @@ RSpec.describe API::Ci::Variables do it 'creates variable with optional attributes' do expect do post api("/projects/#{project.id}/variables", user), params: { variable_type: 'file', key: 'TEST_VARIABLE_2', value: 'VALUE_2' } - end.to change {project.variables.count}.by(1) + end.to change { project.variables.count }.by(1) expect(response).to have_gitlab_http_status(:created) expect(json_response['key']).to eq('TEST_VARIABLE_2') @@ -142,7 +142,7 @@ RSpec.describe API::Ci::Variables do it 'does not allow to duplicate variable key' do expect do post api("/projects/#{project.id}/variables", user), params: { key: variable.key, value: 'VALUE_2' } - end.to change {project.variables.count}.by(0) + end.to change { project.variables.count }.by(0) expect(response).to have_gitlab_http_status(:bad_request) end @@ -268,7 +268,7 @@ RSpec.describe API::Ci::Variables do delete api("/projects/#{project.id}/variables/#{variable.key}", user) expect(response).to have_gitlab_http_status(:no_content) - end.to change {project.variables.count}.by(-1) + end.to change { project.variables.count }.by(-1) end it 'responds with 404 Not Found if requesting non-existing variable' do @@ -295,7 +295,7 @@ RSpec.describe API::Ci::Variables do delete api("/projects/#{project.id}/variables/key1", user), params: { 'filter[environment_scope]': 'production' } expect(response).to have_gitlab_http_status(:no_content) - end.to change {project.variables.count}.by(-1) + end.to change { project.variables.count }.by(-1) expect(var1.reload).to be_present expect { var2.reload }.to raise_error(ActiveRecord::RecordNotFound) diff --git a/spec/requests/api/clusters/agents_spec.rb b/spec/requests/api/clusters/agents_spec.rb index 72d4266b9e3..5e3bdd69529 100644 --- a/spec/requests/api/clusters/agents_spec.rb +++ b/spec/requests/api/clusters/agents_spec.rb @@ -101,7 +101,7 @@ RSpec.describe API::Clusters::Agents do expect do post(api("/projects/#{project.id}/cluster_agents", user), params: { name: 'some-agent' }) - end.to change {project.cluster_agents.count}.by(1) + end.to change { project.cluster_agents.count }.by(1) aggregate_failures "testing response" do expect(response).to have_gitlab_http_status(:created) @@ -139,7 +139,7 @@ RSpec.describe API::Clusters::Agents do delete api("/projects/#{project.id}/cluster_agents/#{agent.id}", user) expect(response).to have_gitlab_http_status(:no_content) - end.to change {project.cluster_agents.count}.by(-1) + end.to change { project.cluster_agents.count }.by(-1) end it 'returns a 404 error when deleting non existent agent' do diff --git a/spec/requests/api/commits_spec.rb b/spec/requests/api/commits_spec.rb index 9ef845f06bf..6dd163b908b 100644 --- a/spec/requests/api/commits_spec.rb +++ b/spec/requests/api/commits_spec.rb @@ -988,8 +988,8 @@ RSpec.describe API::Commits do it 'returns all refs with no scope' do get api(route, current_user), params: { per_page: 100 } - refs = project.repository.branch_names_contains(commit_id).map {|name| ['branch', name]} - refs.concat(project.repository.tag_names_contains(commit_id).map {|name| ['tag', name]}) + refs = project.repository.branch_names_contains(commit_id).map { |name| ['branch', name] } + refs.concat(project.repository.tag_names_contains(commit_id).map { |name| ['tag', name] }) expect(response).to have_gitlab_http_status(:ok) expect(response).to include_limited_pagination_headers @@ -1000,8 +1000,8 @@ RSpec.describe API::Commits do it 'returns all refs' do get api(route, current_user), params: { type: 'all', per_page: 100 } - refs = project.repository.branch_names_contains(commit_id).map {|name| ['branch', name]} - refs.concat(project.repository.tag_names_contains(commit_id).map {|name| ['tag', name]}) + refs = project.repository.branch_names_contains(commit_id).map { |name| ['branch', name] } + refs.concat(project.repository.tag_names_contains(commit_id).map { |name| ['tag', name] }) expect(response).to have_gitlab_http_status(:ok) expect(json_response.map { |r| [r['type'], r['name']] }.compact).to eq(refs) @@ -1010,7 +1010,7 @@ RSpec.describe API::Commits do it 'returns the branch refs' do get api(route, current_user), params: { type: 'branch', per_page: 100 } - refs = project.repository.branch_names_contains(commit_id).map {|name| ['branch', name]} + refs = project.repository.branch_names_contains(commit_id).map { |name| ['branch', name] } expect(response).to have_gitlab_http_status(:ok) expect(json_response.map { |r| [r['type'], r['name']] }.compact).to eq(refs) @@ -1019,7 +1019,7 @@ RSpec.describe API::Commits do it 'returns the tag refs' do get api(route, current_user), params: { type: 'tag', per_page: 100 } - refs = project.repository.tag_names_contains(commit_id).map {|name| ['tag', name]} + refs = project.repository.tag_names_contains(commit_id).map { |name| ['tag', name] } expect(response).to have_gitlab_http_status(:ok) expect(json_response.map { |r| [r['type'], r['name']] }.compact).to eq(refs) @@ -2036,7 +2036,7 @@ RSpec.describe API::Commits do context 'unsigned commit' do it_behaves_like '404 response' do let(:request) { get api(route, current_user) } - let(:message) { '404 Signature Not Found'} + let(:message) { '404 Signature Not Found' } end end diff --git a/spec/requests/api/conan_instance_packages_spec.rb b/spec/requests/api/conan_instance_packages_spec.rb index 54cad3093d7..e4747e0eb99 100644 --- a/spec/requests/api/conan_instance_packages_spec.rb +++ b/spec/requests/api/conan_instance_packages_spec.rb @@ -94,7 +94,7 @@ RSpec.describe API::ConanInstancePackages do end describe 'DELETE /api/v4/packages/conan/v1/conans/:package_name/package_version/:package_username/:package_channel' do - subject { delete api("/packages/conan/v1/conans/#{recipe_path}"), headers: headers} + subject { delete api("/packages/conan/v1/conans/#{recipe_path}"), headers: headers } it_behaves_like 'delete package endpoint' end diff --git a/spec/requests/api/conan_project_packages_spec.rb b/spec/requests/api/conan_project_packages_spec.rb index e28105eb8eb..48e36b55a68 100644 --- a/spec/requests/api/conan_project_packages_spec.rb +++ b/spec/requests/api/conan_project_packages_spec.rb @@ -93,7 +93,7 @@ RSpec.describe API::ConanProjectPackages do end describe 'DELETE /api/v4/projects/:id/packages/conan/v1/conans/:package_name/package_version/:package_username/:package_channel' do - subject { delete api("/projects/#{project_id}/packages/conan/v1/conans/#{recipe_path}"), headers: headers} + subject { delete api("/projects/#{project_id}/packages/conan/v1/conans/#{recipe_path}"), headers: headers } it_behaves_like 'delete package endpoint' end diff --git a/spec/requests/api/dependency_proxy_spec.rb b/spec/requests/api/dependency_proxy_spec.rb index 067852ef1e9..a8617fcb0bf 100644 --- a/spec/requests/api/dependency_proxy_spec.rb +++ b/spec/requests/api/dependency_proxy_spec.rb @@ -4,7 +4,7 @@ require 'spec_helper' RSpec.describe API::DependencyProxy, api: true do let_it_be(:user) { create(:user) } - let_it_be(:blob) { create(:dependency_proxy_blob )} + let_it_be(:blob) { create(:dependency_proxy_blob ) } let_it_be(:group, reload: true) { blob.group } before do diff --git a/spec/requests/api/deployments_spec.rb b/spec/requests/api/deployments_spec.rb index 4328fd4dbe7..8d40ced495f 100644 --- a/spec/requests/api/deployments_spec.rb +++ b/spec/requests/api/deployments_spec.rb @@ -451,7 +451,7 @@ RSpec.describe API::Deployments do describe 'DELETE /projects/:id/deployments/:deployment_id' do let(:project) { create(:project, :repository) } let(:environment) { create(:environment, project: project) } - let(:commits) { project.repository.commits(nil, { limit: 2 })} + let(:commits) { project.repository.commits(nil, { limit: 2 }) } let!(:deploy) do create( :deployment, diff --git a/spec/requests/api/go_proxy_spec.rb b/spec/requests/api/go_proxy_spec.rb index 0143340de11..2b1250320ce 100644 --- a/spec/requests/api/go_proxy_spec.rb +++ b/spec/requests/api/go_proxy_spec.rb @@ -318,7 +318,7 @@ RSpec.describe API::GoProxy do context 'with a case sensitive project and versions' do let_it_be(:project) { create :project_empty_repo, :public, creator: user, path: 'MyGoLib' } let_it_be(:base) { "#{Settings.build_gitlab_go_url}/#{project.full_path}" } - let_it_be(:base_encoded) { base.gsub(/[A-Z]/) { |s| "!#{s.downcase}"} } + let_it_be(:base_encoded) { base.gsub(/[A-Z]/) { |s| "!#{s.downcase}" } } let_it_be(:modules) do create(:go_module_commit, :files, project: project, files: { 'README.md' => "Hi" }) diff --git a/spec/requests/api/graphql/boards/board_list_issues_query_spec.rb b/spec/requests/api/graphql/boards/board_list_issues_query_spec.rb index 6324db0be4a..484ddc3469b 100644 --- a/spec/requests/api/graphql/boards/board_list_issues_query_spec.rb +++ b/spec/requests/api/graphql/boards/board_list_issues_query_spec.rb @@ -15,7 +15,7 @@ RSpec.describe 'get board lists' do let_it_be(:group_label2) { create(:group_label, group: group, name: 'Testing') } let(:params) { '' } - let(:board) { } + let(:board) {} let(:confidential) { false } let(:board_parent_type) { board_parent.class.to_s.downcase } let(:board_data) { graphql_data[board_parent_type]['boards']['nodes'][0] } diff --git a/spec/requests/api/graphql/boards/board_lists_query_spec.rb b/spec/requests/api/graphql/boards/board_lists_query_spec.rb index 39ff108a9e1..6fe2e41cf35 100644 --- a/spec/requests/api/graphql/boards/board_lists_query_spec.rb +++ b/spec/requests/api/graphql/boards/board_lists_query_spec.rb @@ -15,7 +15,7 @@ RSpec.describe 'get board lists' do let_it_be(:group_label2) { create(:group_label, group: group, name: 'Testing') } let(:params) { '' } - let(:board) { } + let(:board) {} let(:board_parent_type) { board_parent.class.to_s.downcase } let(:board_data) { graphql_data[board_parent_type]['boards']['edges'].first['node'] } let(:lists_data) { board_data['lists']['edges'] } diff --git a/spec/requests/api/graphql/mutations/award_emojis/add_spec.rb b/spec/requests/api/graphql/mutations/award_emojis/add_spec.rb index fdf5503a3a2..3879e58cecf 100644 --- a/spec/requests/api/graphql/mutations/award_emojis/add_spec.rb +++ b/spec/requests/api/graphql/mutations/award_emojis/add_spec.rb @@ -74,7 +74,7 @@ RSpec.describe 'Adding an AwardEmoji' do end describe 'marking Todos as done' do - let(:user) { current_user} + let(:user) { current_user } subject { post_graphql_mutation(mutation, current_user: user) } diff --git a/spec/requests/api/graphql/mutations/award_emojis/toggle_spec.rb b/spec/requests/api/graphql/mutations/award_emojis/toggle_spec.rb index 6b26e37e30c..7ddffa1ab0a 100644 --- a/spec/requests/api/graphql/mutations/award_emojis/toggle_spec.rb +++ b/spec/requests/api/graphql/mutations/award_emojis/toggle_spec.rb @@ -84,7 +84,7 @@ RSpec.describe 'Toggling an AwardEmoji' do end describe 'marking Todos as done' do - let(:user) { current_user} + let(:user) { current_user } subject { post_graphql_mutation(mutation, current_user: user) } diff --git a/spec/requests/api/graphql/mutations/releases/create_spec.rb b/spec/requests/api/graphql/mutations/releases/create_spec.rb index 1e62942c29d..2541072b766 100644 --- a/spec/requests/api/graphql/mutations/releases/create_spec.rb +++ b/spec/requests/api/graphql/mutations/releases/create_spec.rb @@ -16,10 +16,10 @@ RSpec.describe 'Creation of a new release' do let(:mutation_name) { :release_create } - let(:tag_name) { 'v7.12.5'} + let(:tag_name) { 'v7.12.5' } let(:tag_message) { nil } - let(:ref) { 'master'} - let(:name) { 'Version 7.12.5'} + let(:ref) { 'master' } + let(:name) { 'Version 7.12.5' } let(:description) { 'Release 7.12.5 :rocket:' } let(:released_at) { '2018-12-10' } let(:milestones) { [milestone_12_3.title, milestone_12_4.title] } diff --git a/spec/requests/api/graphql/mutations/releases/update_spec.rb b/spec/requests/api/graphql/mutations/releases/update_spec.rb index 0fa3d7de299..33d4e57904c 100644 --- a/spec/requests/api/graphql/mutations/releases/update_spec.rb +++ b/spec/requests/api/graphql/mutations/releases/update_spec.rb @@ -15,7 +15,7 @@ RSpec.describe 'Updating an existing release' do let_it_be(:milestone_12_4) { create(:milestone, project: project, title: '12.4') } let_it_be(:tag_name) { 'v1.1.0' } - let_it_be(:name) { 'Version 7.12.5'} + let_it_be(:name) { 'Version 7.12.5' } let_it_be(:description) { 'Release 7.12.5 :rocket:' } let_it_be(:released_at) { '2018-12-10' } let_it_be(:created_at) { '2018-11-05' } diff --git a/spec/requests/api/graphql/mutations/snippets/create_spec.rb b/spec/requests/api/graphql/mutations/snippets/create_spec.rb index 9a3cea3ca14..264fa5732c3 100644 --- a/spec/requests/api/graphql/mutations/snippets/create_spec.rb +++ b/spec/requests/api/graphql/mutations/snippets/create_spec.rb @@ -12,8 +12,8 @@ RSpec.describe 'Creating a Snippet' do let(:title) { 'Initial title' } let(:visibility_level) { 'public' } let(:action) { :create } - let(:file_1) { { filePath: 'example_file1', content: 'This is the example file 1' }} - let(:file_2) { { filePath: 'example_file2', content: 'This is the example file 2' }} + let(:file_1) { { filePath: 'example_file1', content: 'This is the example file 1' } } + let(:file_2) { { filePath: 'example_file2', content: 'This is the example file 2' } } let(:actions) { [{ action: action }.merge(file_1), { action: action }.merge(file_2)] } let(:project_path) { nil } let(:uploaded_files) { nil } @@ -149,7 +149,7 @@ RSpec.describe 'Creating a Snippet' do end context 'when there non ActiveRecord errors' do - let(:file_1) { { filePath: 'invalid://file/path', content: 'foobar' }} + let(:file_1) { { filePath: 'invalid://file/path', content: 'foobar' } } it_behaves_like 'a mutation that returns errors in the response', errors: ['Repository Error creating the snippet - Invalid file name'] it_behaves_like 'does not create snippet' diff --git a/spec/requests/api/graphql/mutations/timelogs/delete_spec.rb b/spec/requests/api/graphql/mutations/timelogs/delete_spec.rb index b674e77f093..d304bfbdf00 100644 --- a/spec/requests/api/graphql/mutations/timelogs/delete_spec.rb +++ b/spec/requests/api/graphql/mutations/timelogs/delete_spec.rb @@ -7,7 +7,7 @@ RSpec.describe 'Delete a timelog' do let_it_be(:author) { create(:user) } let_it_be(:project) { create(:project, :public) } let_it_be(:issue) { create(:issue, project: project) } - let_it_be(:timelog) { create(:timelog, user: author, issue: issue, time_spent: 1800)} + let_it_be(:timelog) { create(:timelog, user: author, issue: issue, time_spent: 1800) } let(:current_user) { nil } let(:mutation) { graphql_mutation(:timelogDelete, { 'id' => timelog.to_global_id.to_s }) } diff --git a/spec/requests/api/graphql/mutations/work_items/create_spec.rb b/spec/requests/api/graphql/mutations/work_items/create_spec.rb index 2a542cef5de..8233821053f 100644 --- a/spec/requests/api/graphql/mutations/work_items/create_spec.rb +++ b/spec/requests/api/graphql/mutations/work_items/create_spec.rb @@ -129,7 +129,7 @@ RSpec.describe 'Create a work item' do end context 'when parent work item is not found' do - let_it_be(:parent) { build_stubbed(:work_item, id: non_existing_record_id)} + let_it_be(:parent) { build_stubbed(:work_item, id: non_existing_record_id) } it 'returns a top level error' do post_graphql_mutation(mutation, current_user: current_user) diff --git a/spec/requests/api/graphql/mutations/work_items/update_spec.rb b/spec/requests/api/graphql/mutations/work_items/update_spec.rb index bd6ec4b9535..6ee3d5b1d35 100644 --- a/spec/requests/api/graphql/mutations/work_items/update_spec.rb +++ b/spec/requests/api/graphql/mutations/work_items/update_spec.rb @@ -103,7 +103,7 @@ RSpec.describe 'Update a work item' do let(:input) { { 'confidential' => true } } it_behaves_like 'toggling confidentiality' do - let(:values) { { old: false, new: true }} + let(:values) { { old: false, new: true } } end end @@ -115,7 +115,7 @@ RSpec.describe 'Update a work item' do end it_behaves_like 'toggling confidentiality' do - let(:values) { { old: true, new: false }} + let(:values) { { old: true, new: false } } end end end diff --git a/spec/requests/api/graphql/namespace/root_storage_statistics_spec.rb b/spec/requests/api/graphql/namespace/root_storage_statistics_spec.rb index 37cc502103d..8d8a0baae36 100644 --- a/spec/requests/api/graphql/namespace/root_storage_statistics_spec.rb +++ b/spec/requests/api/graphql/namespace/root_storage_statistics_spec.rb @@ -49,7 +49,7 @@ RSpec.describe 'rendering namespace statistics' do it_behaves_like 'a working namespace with storage statistics query' context 'when the namespace is public' do - let(:group) { create(:group, :public)} + let(:group) { create(:group, :public) } it 'hides statistics for unauthenticated requests' do post_graphql(query, current_user: nil) diff --git a/spec/requests/api/graphql/packages/conan_spec.rb b/spec/requests/api/graphql/packages/conan_spec.rb index 1f3732980d9..5bd5a71bbeb 100644 --- a/spec/requests/api/graphql/packages/conan_spec.rb +++ b/spec/requests/api/graphql/packages/conan_spec.rb @@ -8,7 +8,7 @@ RSpec.describe 'conan package details' do let_it_be(:package) { create(:conan_package, project: project) } let(:metadata) { query_graphql_fragment('ConanMetadata') } - let(:package_files_metadata) {query_graphql_fragment('ConanFileMetadata')} + let(:package_files_metadata) { query_graphql_fragment('ConanFileMetadata') } let(:query) do graphql_query_for(:package, { id: package_global_id }, <<~FIELDS) diff --git a/spec/requests/api/graphql/packages/helm_spec.rb b/spec/requests/api/graphql/packages/helm_spec.rb index 397096f70db..1675b8faa23 100644 --- a/spec/requests/api/graphql/packages/helm_spec.rb +++ b/spec/requests/api/graphql/packages/helm_spec.rb @@ -7,7 +7,7 @@ RSpec.describe 'helm package details' do let_it_be(:package) { create(:helm_package, project: project) } - let(:package_files_metadata) {query_graphql_fragment('HelmFileMetadata')} + let(:package_files_metadata) { query_graphql_fragment('HelmFileMetadata') } let(:query) do graphql_query_for(:package, { id: package_global_id }, <<~FIELDS) diff --git a/spec/requests/api/graphql/packages/package_spec.rb b/spec/requests/api/graphql/packages/package_spec.rb index 0335c1085b4..c28b37db5af 100644 --- a/spec/requests/api/graphql/packages/package_spec.rb +++ b/spec/requests/api/graphql/packages/package_spec.rb @@ -18,7 +18,7 @@ RSpec.describe 'package details' do let(:depth) { 3 } let(:excluded) { %w[metadata apiFuzzingCiConfiguration pipeline packageFiles] } let(:metadata) { query_graphql_fragment('ComposerMetadata') } - let(:package_files) {all_graphql_fields_for('PackageFile')} + let(:package_files) { all_graphql_fields_for('PackageFile') } let(:package_global_id) { global_id_of(composer_package) } let(:package_details) { graphql_data_at(:package) } diff --git a/spec/requests/api/graphql/project/base_service_spec.rb b/spec/requests/api/graphql/project/base_service_spec.rb index 5dc0f55db88..58d10ade8cf 100644 --- a/spec/requests/api/graphql/project/base_service_spec.rb +++ b/spec/requests/api/graphql/project/base_service_spec.rb @@ -26,7 +26,7 @@ RSpec.describe 'query Jira service' do ) end - let(:services) { graphql_data.dig('project', 'services', 'nodes')} + let(:services) { graphql_data.dig('project', 'services', 'nodes') } it_behaves_like 'unauthorized users cannot read services' diff --git a/spec/requests/api/graphql/project/jira_import_spec.rb b/spec/requests/api/graphql/project/jira_import_spec.rb index 98a3f08baa6..202220f4bf6 100644 --- a/spec/requests/api/graphql/project/jira_import_spec.rb +++ b/spec/requests/api/graphql/project/jira_import_spec.rb @@ -56,8 +56,8 @@ RSpec.describe 'query Jira import data' do ) end - let(:jira_imports) { graphql_data.dig('project', 'jiraImports', 'nodes')} - let(:jira_import_status) { graphql_data.dig('project', 'jiraImportStatus')} + let(:jira_imports) { graphql_data.dig('project', 'jiraImports', 'nodes') } + let(:jira_import_status) { graphql_data.dig('project', 'jiraImportStatus') } context 'when user cannot read Jira import data' do before do @@ -89,11 +89,11 @@ RSpec.describe 'query Jira import data' do context 'list of jira imports sorted ascending by scheduledAt time' do it 'retuns list of jira imports' do - jira_proket_keys = jira_imports.map {|ji| ji['jiraProjectKey']} - usernames = jira_imports.map {|ji| ji.dig('scheduledBy', 'username')} - imported_issues_count = jira_imports.map {|ji| ji.dig('importedIssuesCount')} - failed_issues_count = jira_imports.map {|ji| ji.dig('failedToImportCount')} - total_issue_count = jira_imports.map {|ji| ji.dig('totalIssueCount')} + jira_proket_keys = jira_imports.map { |ji| ji['jiraProjectKey'] } + usernames = jira_imports.map { |ji| ji.dig('scheduledBy', 'username') } + imported_issues_count = jira_imports.map { |ji| ji.dig('importedIssuesCount') } + failed_issues_count = jira_imports.map { |ji| ji.dig('failedToImportCount') } + total_issue_count = jira_imports.map { |ji| ji.dig('totalIssueCount') } expect(jira_imports.size).to eq 2 expect(jira_proket_keys).to eq %w(BB AA) diff --git a/spec/requests/api/group_variables_spec.rb b/spec/requests/api/group_variables_spec.rb index a7b4bea362f..4fed7dd7624 100644 --- a/spec/requests/api/group_variables_spec.rb +++ b/spec/requests/api/group_variables_spec.rb @@ -91,7 +91,7 @@ RSpec.describe API::GroupVariables do it 'creates variable' do expect do post api("/groups/#{group.id}/variables", user), params: { key: 'TEST_VARIABLE_2', value: 'PROTECTED_VALUE_2', protected: true, masked: true } - end.to change {group.variables.count}.by(1) + end.to change { group.variables.count }.by(1) expect(response).to have_gitlab_http_status(:created) expect(json_response['key']).to eq('TEST_VARIABLE_2') @@ -105,7 +105,7 @@ RSpec.describe API::GroupVariables do it 'creates variable with optional attributes' do expect do post api("/groups/#{group.id}/variables", user), params: { variable_type: 'file', key: 'TEST_VARIABLE_2', value: 'VALUE_2' } - end.to change {group.variables.count}.by(1) + end.to change { group.variables.count }.by(1) expect(response).to have_gitlab_http_status(:created) expect(json_response['key']).to eq('TEST_VARIABLE_2') @@ -119,7 +119,7 @@ RSpec.describe API::GroupVariables do it 'does not allow to duplicate variable key' do expect do post api("/groups/#{group.id}/variables", user), params: { key: variable.key, value: 'VALUE_2' } - end.to change {group.variables.count}.by(0) + end.to change { group.variables.count }.by(0) expect(response).to have_gitlab_http_status(:bad_request) end @@ -207,7 +207,7 @@ RSpec.describe API::GroupVariables do delete api("/groups/#{group.id}/variables/#{variable.key}", user) expect(response).to have_gitlab_http_status(:no_content) - end.to change {group.variables.count}.by(-1) + end.to change { group.variables.count }.by(-1) end it 'responds with 404 Not Found if requesting non-existing variable' do diff --git a/spec/requests/api/groups_spec.rb b/spec/requests/api/groups_spec.rb index 3bc3cce5310..bc37f8e4655 100644 --- a/spec/requests/api/groups_spec.rb +++ b/spec/requests/api/groups_spec.rb @@ -864,7 +864,7 @@ RSpec.describe API::Groups do end describe 'PUT /groups/:id' do - let(:new_group_name) { 'New Group'} + let(:new_group_name) { 'New Group' } let(:file_path) { 'spec/fixtures/dk.png' } it_behaves_like 'group avatar upload' do diff --git a/spec/requests/api/helpers_spec.rb b/spec/requests/api/helpers_spec.rb index 8961f3177b6..c961fd9cfc8 100644 --- a/spec/requests/api/helpers_spec.rb +++ b/spec/requests/api/helpers_spec.rb @@ -26,8 +26,8 @@ RSpec.describe API::Helpers do } end - let(:header) { } - let(:request) { Grape::Request.new(env)} + let(:header) {} + let(:request) { Grape::Request.new(env) } let(:params) { request.params } before do diff --git a/spec/requests/api/internal/base_spec.rb b/spec/requests/api/internal/base_spec.rb index acfe476a864..cc329b87047 100644 --- a/spec/requests/api/internal/base_spec.rb +++ b/spec/requests/api/internal/base_spec.rb @@ -1451,7 +1451,7 @@ RSpec.describe API::Internal::Base do describe 'POST /internal/two_factor_otp_check' do let(:key_id) { key.id } - let(:otp) { '123456'} + let(:otp) { '123456' } subject do post api('/internal/two_factor_otp_check'), @@ -1472,7 +1472,7 @@ RSpec.describe API::Internal::Base do describe 'POST /internal/two_factor_manual_otp_check' do let(:key_id) { key.id } - let(:otp) { '123456'} + let(:otp) { '123456' } subject do post api('/internal/two_factor_manual_otp_check'), @@ -1493,7 +1493,7 @@ RSpec.describe API::Internal::Base do describe 'POST /internal/two_factor_push_otp_check' do let(:key_id) { key.id } - let(:otp) { '123456'} + let(:otp) { '123456' } subject do post api('/internal/two_factor_push_otp_check'), @@ -1514,7 +1514,7 @@ RSpec.describe API::Internal::Base do describe 'POST /internal/two_factor_manual_otp_check' do let(:key_id) { key.id } - let(:otp) { '123456'} + let(:otp) { '123456' } subject do post api('/internal/two_factor_manual_otp_check'), @@ -1534,7 +1534,7 @@ RSpec.describe API::Internal::Base do describe 'POST /internal/two_factor_push_otp_check' do let(:key_id) { key.id } - let(:otp) { '123456'} + let(:otp) { '123456' } subject do post api('/internal/two_factor_push_otp_check'), diff --git a/spec/requests/api/markdown_spec.rb b/spec/requests/api/markdown_spec.rb index 47e1f007daa..15283b5cc63 100644 --- a/spec/requests/api/markdown_spec.rb +++ b/spec/requests/api/markdown_spec.rb @@ -131,7 +131,7 @@ RSpec.describe API::Markdown do end context 'when not logged in' do - let(:user) { } + let(:user) {} it_behaves_like 'user without proper access' end @@ -176,7 +176,7 @@ RSpec.describe API::Markdown do end context 'when not logged in' do - let(:user) { } + let(:user) {} it_behaves_like 'user without proper access' end diff --git a/spec/requests/api/maven_packages_spec.rb b/spec/requests/api/maven_packages_spec.rb index 321592fd844..1b378788b6a 100644 --- a/spec/requests/api/maven_packages_spec.rb +++ b/spec/requests/api/maven_packages_spec.rb @@ -34,7 +34,7 @@ RSpec.describe API::MavenPackages do end let(:version) { '1.0-SNAPSHOT' } - let(:param_path) { "#{package_name}/#{version}"} + let(:param_path) { "#{package_name}/#{version}" } before do project.add_developer(user) diff --git a/spec/requests/api/members_spec.rb b/spec/requests/api/members_spec.rb index e4c2f17af47..3a722b7b518 100644 --- a/spec/requests/api/members_spec.rb +++ b/spec/requests/api/members_spec.rb @@ -187,8 +187,8 @@ RSpec.describe API::Members do end context 'with a subgroup' do - let(:group) { create(:group, :private)} - let(:subgroup) { create(:group, :private, parent: group)} + let(:group) { create(:group, :private) } + let(:subgroup) { create(:group, :private, parent: group) } let(:project) { create(:project, group: subgroup) } before do diff --git a/spec/requests/api/metrics/dashboard/annotations_spec.rb b/spec/requests/api/metrics/dashboard/annotations_spec.rb index 79a38702354..5e64ac7d481 100644 --- a/spec/requests/api/metrics/dashboard/annotations_spec.rb +++ b/spec/requests/api/metrics/dashboard/annotations_spec.rb @@ -10,7 +10,7 @@ RSpec.describe API::Metrics::Dashboard::Annotations do let(:dashboard) { 'config/prometheus/common_metrics.yml' } let(:starting_at) { Time.now.iso8601 } let(:ending_at) { 1.hour.from_now.iso8601 } - let(:params) { attributes_for(:metrics_dashboard_annotation, environment: environment, starting_at: starting_at, ending_at: ending_at, dashboard_path: dashboard)} + let(:params) { attributes_for(:metrics_dashboard_annotation, environment: environment, starting_at: starting_at, ending_at: ending_at, dashboard_path: dashboard) } shared_examples 'POST /:source_type/:id/metrics_dashboard/annotations' do |source_type| let(:url) { "/#{source_type.pluralize}/#{source.id}/metrics_dashboard/annotations" } diff --git a/spec/requests/api/notes_spec.rb b/spec/requests/api/notes_spec.rb index f6a65274ca2..89abb28140a 100644 --- a/spec/requests/api/notes_spec.rb +++ b/spec/requests/api/notes_spec.rb @@ -111,7 +111,7 @@ RSpec.describe API::Notes do system: false end - let(:test_url) {"/projects/#{ext_proj.id}/issues/#{ext_issue.iid}/notes"} + let(:test_url) { "/projects/#{ext_proj.id}/issues/#{ext_issue.iid}/notes" } shared_examples 'a notes request' do it 'is a note array response' do diff --git a/spec/requests/api/npm_project_packages_spec.rb b/spec/requests/api/npm_project_packages_spec.rb index 62809b432af..6061b3ba965 100644 --- a/spec/requests/api/npm_project_packages_spec.rb +++ b/spec/requests/api/npm_project_packages_spec.rb @@ -307,8 +307,8 @@ RSpec.describe API::NpmProjectPackages do expect { upload_package_with_token } .to change { project.packages.count }.by(1) .and change { Packages::PackageFile.count }.by(1) - .and change { Packages::Dependency.count}.by(4) - .and change { Packages::DependencyLink.count}.by(6) + .and change { Packages::Dependency.count }.by(4) + .and change { Packages::DependencyLink.count }.by(6) expect(response).to have_gitlab_http_status(:ok) end @@ -323,8 +323,8 @@ RSpec.describe API::NpmProjectPackages do expect { upload_package_with_token } .to change { project.packages.count }.by(1) .and change { Packages::PackageFile.count }.by(1) - .and not_change { Packages::Dependency.count} - .and change { Packages::DependencyLink.count}.by(6) + .and not_change { Packages::Dependency.count } + .and change { Packages::DependencyLink.count }.by(6) end end end diff --git a/spec/requests/api/nuget_group_packages_spec.rb b/spec/requests/api/nuget_group_packages_spec.rb index 1b71f0f9de1..c1375288809 100644 --- a/spec/requests/api/nuget_group_packages_spec.rb +++ b/spec/requests/api/nuget_group_packages_spec.rb @@ -73,7 +73,7 @@ RSpec.describe API::NugetGroupPackages do let(:include_prereleases) { true } let(:query_parameters) { { q: search_term, take: take, skip: skip, prerelease: include_prereleases }.compact } - subject { get api(url), headers: {}} + subject { get api(url), headers: {} } shared_examples 'handling mixed visibilities' do where(:group_visibility, :subgroup_visibility, :expected_status) do diff --git a/spec/requests/api/pages/pages_spec.rb b/spec/requests/api/pages/pages_spec.rb index 0eb2ae64f43..7d44ff533aa 100644 --- a/spec/requests/api/pages/pages_spec.rb +++ b/spec/requests/api/pages/pages_spec.rb @@ -19,7 +19,7 @@ RSpec.describe API::Pages do end it_behaves_like '404 response' do - let(:request) { delete api("/projects/#{project.id}/pages", admin)} + let(:request) { delete api("/projects/#{project.id}/pages", admin) } end end diff --git a/spec/requests/api/pages_domains_spec.rb b/spec/requests/api/pages_domains_spec.rb index 75183156c9d..cd4e8b30d8f 100644 --- a/spec/requests/api/pages_domains_spec.rb +++ b/spec/requests/api/pages_domains_spec.rb @@ -19,8 +19,8 @@ RSpec.describe API::PagesDomains do end let(:pages_domain_secure_params) { build(:pages_domain, domain: 'ssl.other-domain.test', project: project).slice(:domain, :certificate, :key) } - let(:pages_domain_secure_key_missmatch_params) {build(:pages_domain, :with_trusted_chain, project: project).slice(:domain, :certificate, :key) } - let(:pages_domain_secure_missing_chain_params) {build(:pages_domain, :with_missing_chain, project: project).slice(:certificate) } + let(:pages_domain_secure_key_missmatch_params) { build(:pages_domain, :with_trusted_chain, project: project).slice(:domain, :certificate, :key) } + let(:pages_domain_secure_missing_chain_params) { build(:pages_domain, :with_missing_chain, project: project).slice(:certificate) } let(:route) { "/projects/#{project.id}/pages/domains" } let(:route_domain) { "/projects/#{project.id}/pages/domains/#{pages_domain.domain}" } diff --git a/spec/requests/api/personal_access_tokens_spec.rb b/spec/requests/api/personal_access_tokens_spec.rb index 403c646ee32..f261e7db024 100644 --- a/spec/requests/api/personal_access_tokens_spec.rb +++ b/spec/requests/api/personal_access_tokens_spec.rb @@ -34,7 +34,7 @@ RSpec.describe API::PersonalAccessTokens do context 'logged in as a non-Administrator' do let_it_be(:current_user) { create(:user) } let_it_be(:user) { create(:user) } - let_it_be(:token) { create(:personal_access_token, user: current_user)} + let_it_be(:token) { create(:personal_access_token, user: current_user) } let_it_be(:other_token) { create(:personal_access_token, user: user) } let_it_be(:token_impersonated) { create(:personal_access_token, impersonation: true, user: current_user) } diff --git a/spec/requests/api/project_templates_spec.rb b/spec/requests/api/project_templates_spec.rb index 070fd6db3dc..87d70a87f42 100644 --- a/spec/requests/api/project_templates_spec.rb +++ b/spec/requests/api/project_templates_spec.rb @@ -77,7 +77,7 @@ RSpec.describe API::ProjectTemplates do expect(response).to have_gitlab_http_status(:ok) expect(response).to include_pagination_headers expect(response).to match_response_schema('public_api/v4/template_list') - expect(json_response.map {|t| t['key']}).to match_array(%w(bug feature_proposal template_test)) + expect(json_response.map { |t| t['key'] }).to match_array(%w(bug feature_proposal template_test)) end it 'returns merge request templates' do @@ -86,7 +86,7 @@ RSpec.describe API::ProjectTemplates do expect(response).to have_gitlab_http_status(:ok) expect(response).to include_pagination_headers expect(response).to match_response_schema('public_api/v4/template_list') - expect(json_response.map {|t| t['key']}).to match_array(%w(bug feature_proposal template_test)) + expect(json_response.map { |t| t['key'] }).to match_array(%w(bug feature_proposal template_test)) end it 'returns 400 for an unknown template type' do diff --git a/spec/requests/api/projects_spec.rb b/spec/requests/api/projects_spec.rb index ae689d7327b..d3c65e11ed7 100644 --- a/spec/requests/api/projects_spec.rb +++ b/spec/requests/api/projects_spec.rb @@ -1093,7 +1093,7 @@ RSpec.describe API::Projects do it 'does not create new project and respond with 403' do allow_any_instance_of(User).to receive(:projects_limit_left).and_return(0) expect { post api('/projects', user2), params: { name: 'foo' } } - .to change {Project.count}.by(0) + .to change { Project.count }.by(0) expect(response).to have_gitlab_http_status(:forbidden) end end diff --git a/spec/requests/api/pypi_packages_spec.rb b/spec/requests/api/pypi_packages_spec.rb index 9e0d3780fd8..6c130bb4963 100644 --- a/spec/requests/api/pypi_packages_spec.rb +++ b/spec/requests/api/pypi_packages_spec.rb @@ -41,7 +41,7 @@ RSpec.describe API::PypiPackages do it_behaves_like 'deploy token for package GET requests' context 'with group path as id' do - let(:url) { "/groups/#{CGI.escape(group.full_path)}/-/packages/pypi/simple"} + let(:url) { "/groups/#{CGI.escape(group.full_path)}/-/packages/pypi/simple" } it_behaves_like 'deploy token for package GET requests' end @@ -102,7 +102,7 @@ RSpec.describe API::PypiPackages do it_behaves_like 'deploy token for package GET requests' context 'with group path as id' do - let(:url) { "/groups/#{CGI.escape(group.full_path)}/-/packages/pypi/simple/#{package_name}"} + let(:url) { "/groups/#{CGI.escape(group.full_path)}/-/packages/pypi/simple/#{package_name}" } it_behaves_like 'deploy token for package GET requests' end diff --git a/spec/requests/api/release/links_spec.rb b/spec/requests/api/release/links_spec.rb index 2345c0063dd..57b2e005929 100644 --- a/spec/requests/api/release/links_spec.rb +++ b/spec/requests/api/release/links_spec.rb @@ -66,7 +66,7 @@ RSpec.describe API::Release::Links do end context 'when release does not exist' do - let!(:release) { } + let!(:release) {} it_behaves_like '404 response' do let(:request) { get api("/projects/#{project.id}/releases/v0.1/assets/links", maintainer) } @@ -98,7 +98,7 @@ RSpec.describe API::Release::Links do end context 'when the release does not exists' do - let!(:release) { } + let!(:release) {} it_behaves_like '403 response' do let(:request) { get api("/projects/#{project.id}/releases/v0.1/assets/links", non_project_member) } @@ -409,7 +409,7 @@ RSpec.describe API::Release::Links do end context 'when there are no corresponding release link' do - let!(:release_link) { } + let!(:release_link) {} it_behaves_like '404 response' do let(:request) do @@ -510,7 +510,7 @@ RSpec.describe API::Release::Links do end context 'when there are no corresponding release link' do - let!(:release_link) { } + let!(:release_link) {} it_behaves_like '404 response' do let(:request) do diff --git a/spec/requests/api/releases_spec.rb b/spec/requests/api/releases_spec.rb index c050214ff50..1d9e3a6c887 100644 --- a/spec/requests/api/releases_spec.rb +++ b/spec/requests/api/releases_spec.rb @@ -962,7 +962,7 @@ RSpec.describe API::Releases do context 'with milestones' do let(:subject) { post api("/projects/#{project.id}/releases", maintainer), params: params } let(:milestone) { create(:milestone, project: project, title: 'v1.0') } - let(:returned_milestones) { json_response['milestones'].map {|m| m['title']} } + let(:returned_milestones) { json_response['milestones'].map { |m| m['title'] } } before do params.merge!(milestone_params) @@ -1120,7 +1120,7 @@ RSpec.describe API::Releases do end context 'when there are no corresponding releases' do - let!(:release) { } + let!(:release) {} it 'forbids the request' do put api("/projects/#{project.id}/releases/v0.1", maintainer), params: params @@ -1158,7 +1158,7 @@ RSpec.describe API::Releases do end context 'with milestones' do - let(:returned_milestones) { json_response['milestones'].map {|m| m['title']} } + let(:returned_milestones) { json_response['milestones'].map { |m| m['title'] } } subject { put api("/projects/#{project.id}/releases/v0.1", maintainer), params: params } @@ -1310,7 +1310,7 @@ RSpec.describe API::Releases do end context 'when there are no corresponding releases' do - let!(:release) { } + let!(:release) {} it 'forbids the request' do delete api("/projects/#{project.id}/releases/v0.1", maintainer) diff --git a/spec/requests/api/snippets_spec.rb b/spec/requests/api/snippets_spec.rb index 0ba1011684a..0dd6e484e8d 100644 --- a/spec/requests/api/snippets_spec.rb +++ b/spec/requests/api/snippets_spec.rb @@ -28,7 +28,7 @@ RSpec.describe API::Snippets, factory_default: :keep do expect(response).to have_gitlab_http_status(:ok) expect(response).to include_pagination_headers expect(json_response).to be_an Array - expect(json_response.map { |snippet| snippet['id']} ).to contain_exactly( + expect(json_response.map { |snippet| snippet['id'] } ).to contain_exactly( public_snippet.id, internal_snippet.id, private_snippet.id) @@ -75,7 +75,7 @@ RSpec.describe API::Snippets, factory_default: :keep do it 'returns snippets available for user in given time range' do get api(path, personal_access_token: user_token) - expect(json_response.map { |snippet| snippet['id']} ).to contain_exactly( + expect(json_response.map { |snippet| snippet['id'] } ).to contain_exactly( private_snippet_in_time_range1.id, private_snippet_in_time_range2.id) end @@ -99,10 +99,10 @@ RSpec.describe API::Snippets, factory_default: :keep do expect(response).to have_gitlab_http_status(:ok) expect(response).to include_pagination_headers expect(json_response).to be_an Array - expect(json_response.map { |snippet| snippet['id']} ).to contain_exactly( + expect(json_response.map { |snippet| snippet['id'] } ).to contain_exactly( public_snippet.id, public_snippet_other.id) - expect(json_response.map { |snippet| snippet['web_url']} ).to contain_exactly( + expect(json_response.map { |snippet| snippet['web_url'] } ).to contain_exactly( "http://localhost/-/snippets/#{public_snippet.id}", "http://localhost/-/snippets/#{public_snippet_other.id}") expect(json_response[0]['files'].first).to eq snippet_blob_file(public_snippet_other.blobs.first) @@ -126,7 +126,7 @@ RSpec.describe API::Snippets, factory_default: :keep do it 'returns public snippets available to user in given time range' do get api(path, personal_access_token: user_token) - expect(json_response.map { |snippet| snippet['id']} ).to contain_exactly( + expect(json_response.map { |snippet| snippet['id'] } ).to contain_exactly( public_snippet_in_time_range.id) end end diff --git a/spec/requests/api/unleash_spec.rb b/spec/requests/api/unleash_spec.rb index 7bdb89fb286..3ee895d9421 100644 --- a/spec/requests/api/unleash_spec.rb +++ b/spec/requests/api/unleash_spec.rb @@ -8,8 +8,8 @@ RSpec.describe API::Unleash do let_it_be(:project, refind: true) { create(:project) } let(:project_id) { project.id } - let(:params) { } - let(:headers) { } + let(:params) {} + let(:headers) {} shared_examples 'authenticated request' do context 'when using instance id' do @@ -57,7 +57,7 @@ RSpec.describe API::Unleash do context 'when using header' do let(:client) { create(:operations_feature_flags_client, project: project) } - let(:headers) { { "UNLEASH-INSTANCEID" => client.token }} + let(:headers) { { "UNLEASH-INSTANCEID" => client.token } } it 'responds with OK' do subject |