Commit 1535f1ae authored by Thong Kuah's avatar Thong Kuah

Autocorrect LastKeywordArgument for specs

Based on deprecations/ files downloaded from
https://gitlab.com/gitlab-org/gitlab/-/pipelines/220179974
parent 4050f448
...@@ -492,7 +492,7 @@ RSpec.describe EpicsFinder do ...@@ -492,7 +492,7 @@ RSpec.describe EpicsFinder do
let_it_be(:public_epic2) { create(:epic, :confidential, group: public_group1) } let_it_be(:public_epic2) { create(:epic, :confidential, group: public_group1) }
let(:execute_params) { {} } let(:execute_params) { {} }
subject { described_class.new(search_user, group_id: base_group.id).execute(execute_params) } subject { described_class.new(search_user, group_id: base_group.id).execute(**execute_params) }
it 'returns only public epics' do it 'returns only public epics' do
expect(subject).to match_array([base_epic2, public_epic1]) expect(subject).to match_array([base_epic2, public_epic1])
......
...@@ -28,7 +28,7 @@ RSpec.describe Mutations::Boards::Issues::IssueMoveList do ...@@ -28,7 +28,7 @@ RSpec.describe Mutations::Boards::Issues::IssueMoveList do
end end
subject do subject do
mutation.resolve(params.merge(move_params)) mutation.resolve(**params.merge(move_params))
end end
describe '#resolve' do describe '#resolve' do
......
...@@ -28,13 +28,13 @@ RSpec.describe Mutations::Boards::Lists::Create do ...@@ -28,13 +28,13 @@ RSpec.describe Mutations::Boards::Lists::Create do
describe '#ready?' do describe '#ready?' do
it 'raises an error if required arguments are missing' do it 'raises an error if required arguments are missing' do
expect { mutation.ready?({ board_id: 'some id' }) } expect { mutation.ready?(board_id: 'some id') }
.to raise_error(Gitlab::Graphql::Errors::ArgumentError, .to raise_error(Gitlab::Graphql::Errors::ArgumentError,
'one and only one of backlog or labelId or milestoneId or assigneeId is required') 'one and only one of backlog or labelId or milestoneId or assigneeId is required')
end end
it 'raises an error if too many required arguments are specified' do it 'raises an error if too many required arguments are specified' do
expect { mutation.ready?({ board_id: 'some id', milestone_id: 'some milestone', assignee_id: 'some label' }) } expect { mutation.ready?(board_id: 'some id', milestone_id: 'some milestone', assignee_id: 'some label') }
.to raise_error(Gitlab::Graphql::Errors::ArgumentError, .to raise_error(Gitlab::Graphql::Errors::ArgumentError,
'one and only one of backlog or labelId or milestoneId or assigneeId is required') 'one and only one of backlog or labelId or milestoneId or assigneeId is required')
end end
......
...@@ -22,7 +22,7 @@ RSpec.describe Mutations::Boards::Lists::UpdateLimitMetrics do ...@@ -22,7 +22,7 @@ RSpec.describe Mutations::Boards::Lists::UpdateLimitMetrics do
describe '#ready?' do describe '#ready?' do
it 'raises an error if required arguments are missing' do it 'raises an error if required arguments are missing' do
expect { mutation.ready?({ list_id: 'some id' }) }.to raise_error(Gitlab::Graphql::Errors::ArgumentError, "At least one of the arguments " \ expect { mutation.ready?(list_id: 'some id') }.to raise_error(Gitlab::Graphql::Errors::ArgumentError, "At least one of the arguments " \
"limitMetric, maxIssueCount or maxIssueWeight is required") "limitMetric, maxIssueCount or maxIssueWeight is required")
end end
end end
......
...@@ -10,7 +10,7 @@ RSpec.describe Mutations::Boards::UpdateEpicUserPreferences do ...@@ -10,7 +10,7 @@ RSpec.describe Mutations::Boards::UpdateEpicUserPreferences do
let_it_be(:epic) { create(:epic, group: group) } let_it_be(:epic) { create(:epic, group: group) }
let(:context) { { current_user: user } } let(:context) { { current_user: user } }
subject(:mutation) { described_class.new(object: nil, context: context, field: nil).resolve(mutation_params) } subject(:mutation) { described_class.new(object: nil, context: context, field: nil).resolve(**mutation_params) }
describe '#resolve' do describe '#resolve' do
before do before do
......
...@@ -27,7 +27,7 @@ RSpec.describe Mutations::Boards::Update do ...@@ -27,7 +27,7 @@ RSpec.describe Mutations::Boards::Update do
} }
end end
subject { mutation.resolve(mutation_params) } subject { mutation.resolve(**mutation_params) }
specify { expect(described_class).to require_graphql_authorizations(:admin_board) } specify { expect(described_class).to require_graphql_authorizations(:admin_board) }
...@@ -89,7 +89,7 @@ RSpec.describe Mutations::Boards::Update do ...@@ -89,7 +89,7 @@ RSpec.describe Mutations::Boards::Update do
end end
it 'raises exception when mutually exclusive params are given' do it 'raises exception when mutually exclusive params are given' do
expect { mutation.ready?(mutation_params) } expect { mutation.ready?(**mutation_params) }
.to raise_error(Gitlab::Graphql::Errors::ArgumentError, /one and only one of/) .to raise_error(Gitlab::Graphql::Errors::ArgumentError, /one and only one of/)
end end
end end
......
...@@ -39,7 +39,7 @@ RSpec.describe Mutations::Issues::Create do ...@@ -39,7 +39,7 @@ RSpec.describe Mutations::Issues::Create do
stub_licensed_features(issuable_health_status: true) stub_licensed_features(issuable_health_status: true)
end end
subject { mutation.resolve(mutation_params) } subject { mutation.resolve(**mutation_params) }
context 'when user can create issues' do context 'when user can create issues' do
before do before do
......
...@@ -31,7 +31,7 @@ RSpec.describe Mutations::Issues::Update do ...@@ -31,7 +31,7 @@ RSpec.describe Mutations::Issues::Update do
let(:current_user) { user } let(:current_user) { user }
let(:mutation) { described_class.new(object: nil, context: { current_user: current_user }, field: nil) } let(:mutation) { described_class.new(object: nil, context: { current_user: current_user }, field: nil) }
subject { mutation.resolve(params) } subject { mutation.resolve(**params) }
before do before do
group.clear_memoization(:feature_available) group.clear_memoization(:feature_available)
......
...@@ -262,11 +262,11 @@ RSpec.describe Group do ...@@ -262,11 +262,11 @@ RSpec.describe Group do
it 'does not exceed SQL queries count' do it 'does not exceed SQL queries count' do
groups = described_class.where(id: subgroup1) groups = described_class.where(id: subgroup1)
control_count = ActiveRecord::QueryRecorder.new do control_count = ActiveRecord::QueryRecorder.new do
described_class.groups_user_can_read_epics(groups, user, params) described_class.groups_user_can_read_epics(groups, user, **params)
end.count end.count
groups = described_class.where(id: [subgroup1, subgroup2]) groups = described_class.where(id: [subgroup1, subgroup2])
expect { described_class.groups_user_can_read_epics(groups, user, params) } expect { described_class.groups_user_can_read_epics(groups, user, **params) }
.not_to exceed_query_limit(control_count + extra_query_count) .not_to exceed_query_limit(control_count + extra_query_count)
end end
end end
......
...@@ -17,7 +17,7 @@ RSpec.describe Repositories::GitHttpController, type: :request do ...@@ -17,7 +17,7 @@ RSpec.describe Repositories::GitHttpController, type: :request do
describe 'GET #info_refs' do describe 'GET #info_refs' do
context 'smartcard session required' do context 'smartcard session required' do
subject { clone_get(path, env) } subject { clone_get(path, **env) }
before do before do
stub_licensed_features(smartcard_auth: true) stub_licensed_features(smartcard_auth: true)
...@@ -70,7 +70,7 @@ RSpec.describe Repositories::GitHttpController, type: :request do ...@@ -70,7 +70,7 @@ RSpec.describe Repositories::GitHttpController, type: :request do
end end
describe 'POST #git_receive_pack' do describe 'POST #git_receive_pack' do
subject { push_post(path, env) } subject { push_post(path, **env) }
context 'when node is a primary Geo one' do context 'when node is a primary Geo one' do
before do before do
......
...@@ -14,7 +14,7 @@ RSpec.shared_examples 'updating health status' do ...@@ -14,7 +14,7 @@ RSpec.shared_examples 'updating health status' do
end end
end end
subject { mutation.resolve(params) } subject { mutation.resolve(**params) }
context 'when the user has permission' do context 'when the user has permission' do
before do before do
......
...@@ -133,7 +133,7 @@ RSpec.shared_examples 'a blob replicator' do ...@@ -133,7 +133,7 @@ RSpec.shared_examples 'a blob replicator' do
expect(::Geo::FileRegistryRemovalService) expect(::Geo::FileRegistryRemovalService)
.to receive(:new).with(secondary_side_replicator.replicable_name, model_record_id, blob_path).and_return(service) .to receive(:new).with(secondary_side_replicator.replicable_name, model_record_id, blob_path).and_return(service)
secondary_side_replicator.consume(:deleted, deleted_params) secondary_side_replicator.consume(:deleted, **deleted_params)
end end
end end
end end
......
...@@ -56,8 +56,8 @@ RSpec.describe 'Profile > Active Sessions', :clean_gitlab_redis_shared_state do ...@@ -56,8 +56,8 @@ RSpec.describe 'Profile > Active Sessions', :clean_gitlab_redis_shared_state do
visit profile_active_sessions_path visit profile_active_sessions_path
expect(page).to( expect(page).to(
have_selector('ul.list-group li.list-group-item', { text: 'Signed in on', have_selector('ul.list-group li.list-group-item', text: 'Signed in on',
count: 2 })) count: 2))
expect(page).to have_content( expect(page).to have_content(
'127.0.0.1 ' \ '127.0.0.1 ' \
......
...@@ -8,7 +8,7 @@ RSpec.describe Ci::PipelineSchedulesFinder do ...@@ -8,7 +8,7 @@ RSpec.describe Ci::PipelineSchedulesFinder do
let!(:active_schedule) { create(:ci_pipeline_schedule, project: project) } let!(:active_schedule) { create(:ci_pipeline_schedule, project: project) }
let!(:inactive_schedule) { create(:ci_pipeline_schedule, :inactive, project: project) } let!(:inactive_schedule) { create(:ci_pipeline_schedule, :inactive, project: project) }
subject { described_class.new(project).execute(params) } subject { described_class.new(project).execute(**params) }
describe "#execute" do describe "#execute" do
context 'when the scope is nil' do context 'when the scope is nil' do
......
...@@ -18,7 +18,7 @@ RSpec.describe FeatureFlagsFinder do ...@@ -18,7 +18,7 @@ RSpec.describe FeatureFlagsFinder do
end end
describe '#execute' do describe '#execute' do
subject { finder.execute(args) } subject { finder.execute(**args) }
let!(:feature_flag_1) { create(:operations_feature_flag, name: 'flag-a', project: project) } let!(:feature_flag_1) { create(:operations_feature_flag, name: 'flag-a', project: project) }
let!(:feature_flag_2) { create(:operations_feature_flag, name: 'flag-b', project: project) } let!(:feature_flag_2) { create(:operations_feature_flag, name: 'flag-b', project: project) }
......
...@@ -11,7 +11,7 @@ RSpec.describe Mutations::AlertManagement::HttpIntegration::Destroy do ...@@ -11,7 +11,7 @@ RSpec.describe Mutations::AlertManagement::HttpIntegration::Destroy do
specify { expect(described_class).to require_graphql_authorizations(:admin_operations) } specify { expect(described_class).to require_graphql_authorizations(:admin_operations) }
describe '#resolve' do describe '#resolve' do
subject(:resolve) { mutation_for(project, current_user).resolve(args) } subject(:resolve) { mutation_for(project, current_user).resolve(**args) }
context 'user has access to project' do context 'user has access to project' do
before do before do
......
...@@ -11,7 +11,7 @@ RSpec.describe Mutations::AlertManagement::HttpIntegration::ResetToken do ...@@ -11,7 +11,7 @@ RSpec.describe Mutations::AlertManagement::HttpIntegration::ResetToken do
specify { expect(described_class).to require_graphql_authorizations(:admin_operations) } specify { expect(described_class).to require_graphql_authorizations(:admin_operations) }
describe '#resolve' do describe '#resolve' do
subject(:resolve) { mutation_for(project, current_user).resolve(args) } subject(:resolve) { mutation_for(project, current_user).resolve(**args) }
context 'user has sufficient access to project' do context 'user has sufficient access to project' do
before do before do
......
...@@ -11,7 +11,7 @@ RSpec.describe Mutations::AlertManagement::PrometheusIntegration::ResetToken do ...@@ -11,7 +11,7 @@ RSpec.describe Mutations::AlertManagement::PrometheusIntegration::ResetToken do
specify { expect(described_class).to require_graphql_authorizations(:admin_project) } specify { expect(described_class).to require_graphql_authorizations(:admin_project) }
describe '#resolve' do describe '#resolve' do
subject(:resolve) { mutation_for(project, current_user).resolve(args) } subject(:resolve) { mutation_for(project, current_user).resolve(**args) }
context 'user has sufficient access to project' do context 'user has sufficient access to project' do
before do before do
......
...@@ -12,7 +12,7 @@ RSpec.describe Mutations::AlertManagement::UpdateAlertStatus do ...@@ -12,7 +12,7 @@ RSpec.describe Mutations::AlertManagement::UpdateAlertStatus do
specify { expect(described_class).to require_graphql_authorizations(:update_alert_management_alert) } specify { expect(described_class).to require_graphql_authorizations(:update_alert_management_alert) }
describe '#resolve' do describe '#resolve' do
subject(:resolve) { mutation_for(project, current_user).resolve(args) } subject(:resolve) { mutation_for(project, current_user).resolve(**args) }
context 'user has access to project' do context 'user has access to project' do
before do before do
......
...@@ -34,18 +34,18 @@ RSpec.describe Mutations::Boards::Issues::IssueMoveList do ...@@ -34,18 +34,18 @@ RSpec.describe Mutations::Boards::Issues::IssueMoveList do
end end
subject do subject do
mutation.resolve(params.merge(move_params)) mutation.resolve(**params.merge(move_params))
end end
describe '#ready?' do describe '#ready?' do
it 'raises an error if required arguments are missing' do it 'raises an error if required arguments are missing' do
expect { mutation.ready?(params) } expect { mutation.ready?(**params) }
.to raise_error(Gitlab::Graphql::Errors::ArgumentError, "At least one of the arguments " \ .to raise_error(Gitlab::Graphql::Errors::ArgumentError, "At least one of the arguments " \
"fromListId, toListId, afterId or beforeId is required") "fromListId, toListId, afterId or beforeId is required")
end end
it 'raises an error if only one of fromListId and toListId is present' do it 'raises an error if only one of fromListId and toListId is present' do
expect { mutation.ready?(params.merge(from_list_id: list1.id)) } expect { mutation.ready?(**params.merge(from_list_id: list1.id)) }
.to raise_error(Gitlab::Graphql::Errors::ArgumentError, .to raise_error(Gitlab::Graphql::Errors::ArgumentError,
'Both fromListId and toListId must be present' 'Both fromListId and toListId must be present'
) )
......
...@@ -14,7 +14,7 @@ RSpec.describe Mutations::ContainerExpirationPolicies::Update do ...@@ -14,7 +14,7 @@ RSpec.describe Mutations::ContainerExpirationPolicies::Update do
specify { expect(described_class).to require_graphql_authorizations(:destroy_container_image) } specify { expect(described_class).to require_graphql_authorizations(:destroy_container_image) }
describe '#resolve' do describe '#resolve' do
subject { described_class.new(object: project, context: { current_user: user }, field: nil).resolve(params) } subject { described_class.new(object: project, context: { current_user: user }, field: nil).resolve(**params) }
RSpec.shared_examples 'returning a success' do RSpec.shared_examples 'returning a success' do
it 'returns the container expiration policy with no errors' do it 'returns the container expiration policy with no errors' do
......
...@@ -11,7 +11,7 @@ RSpec.describe Mutations::Discussions::ToggleResolve do ...@@ -11,7 +11,7 @@ RSpec.describe Mutations::Discussions::ToggleResolve do
describe '#resolve' do describe '#resolve' do
subject do subject do
mutation.resolve({ id: id_arg, resolve: resolve_arg }) mutation.resolve(id: id_arg, resolve: resolve_arg)
end end
let(:id_arg) { discussion.to_global_id.to_s } let(:id_arg) { discussion.to_global_id.to_s }
......
...@@ -51,7 +51,7 @@ RSpec.describe Mutations::Issues::Create do ...@@ -51,7 +51,7 @@ RSpec.describe Mutations::Issues::Create do
project.add_guest(assignee2) project.add_guest(assignee2)
end end
subject { mutation.resolve(mutation_params) } subject { mutation.resolve(**mutation_params) }
context 'when the user does not have permission to create an issue' do context 'when the user does not have permission to create an issue' do
it 'raises an error' do it 'raises an error' do
...@@ -117,7 +117,7 @@ RSpec.describe Mutations::Issues::Create do ...@@ -117,7 +117,7 @@ RSpec.describe Mutations::Issues::Create do
end end
it 'raises exception when mutually exclusive params are given' do it 'raises exception when mutually exclusive params are given' do
expect { mutation.ready?(mutation_params) } expect { mutation.ready?(**mutation_params) }
.to raise_error(Gitlab::Graphql::Errors::ArgumentError, /one and only one of/) .to raise_error(Gitlab::Graphql::Errors::ArgumentError, /one and only one of/)
end end
end end
...@@ -128,7 +128,7 @@ RSpec.describe Mutations::Issues::Create do ...@@ -128,7 +128,7 @@ RSpec.describe Mutations::Issues::Create do
end end
it 'raises exception when mutually exclusive params are given' do it 'raises exception when mutually exclusive params are given' do
expect { mutation.ready?(mutation_params) } expect { mutation.ready?(**mutation_params) }
.to raise_error(Gitlab::Graphql::Errors::ArgumentError, /to resolve a discussion please also provide `merge_request_to_resolve_discussions_of` parameter/) .to raise_error(Gitlab::Graphql::Errors::ArgumentError, /to resolve a discussion please also provide `merge_request_to_resolve_discussions_of` parameter/)
end end
end end
...@@ -139,7 +139,7 @@ RSpec.describe Mutations::Issues::Create do ...@@ -139,7 +139,7 @@ RSpec.describe Mutations::Issues::Create do
end end
it 'raises exception when mutually exclusive params are given' do it 'raises exception when mutually exclusive params are given' do
expect { mutation.ready?(mutation_params) }.not_to raise_error expect { mutation.ready?(**mutation_params) }.not_to raise_error
end end
end end
end end
......
...@@ -58,7 +58,7 @@ RSpec.describe Mutations::Labels::Create do ...@@ -58,7 +58,7 @@ RSpec.describe Mutations::Labels::Create do
end end
describe '#ready?' do describe '#ready?' do
subject { mutation.ready?(attributes.merge(extra_params)) } subject { mutation.ready?(**attributes.merge(extra_params)) }
context 'when passing both project_path and group_path' do context 'when passing both project_path and group_path' do
let(:extra_params) { { project_path: 'foo', group_path: 'bar' } } let(:extra_params) { { project_path: 'foo', group_path: 'bar' } }
......
...@@ -7,7 +7,7 @@ RSpec.describe Mutations::Notes::RepositionImageDiffNote do ...@@ -7,7 +7,7 @@ RSpec.describe Mutations::Notes::RepositionImageDiffNote do
describe '#resolve' do describe '#resolve' do
subject do subject do
mutation.resolve({ note: note, position: new_position }) mutation.resolve(note: note, position: new_position)
end end
let_it_be(:noteable) { create(:merge_request) } let_it_be(:noteable) { create(:merge_request) }
......
...@@ -118,7 +118,7 @@ RSpec.describe ApplicationHelper do ...@@ -118,7 +118,7 @@ RSpec.describe ApplicationHelper do
def element(*arguments) def element(*arguments)
@time = Time.zone.parse('2015-07-02 08:23') @time = Time.zone.parse('2015-07-02 08:23')
element = helper.time_ago_with_tooltip(@time, *arguments) element = helper.time_ago_with_tooltip(@time, **arguments)
Nokogiri::HTML::DocumentFragment.parse(element).first_element_child Nokogiri::HTML::DocumentFragment.parse(element).first_element_child
end end
......
...@@ -18,7 +18,7 @@ RSpec.describe Gitlab::Cleanup::ProjectUploads do ...@@ -18,7 +18,7 @@ RSpec.describe Gitlab::Cleanup::ProjectUploads do
let(:args) { [dry_run: false] } let(:args) { [dry_run: false] }
it 'moves the file to its proper location' do it 'moves the file to its proper location' do
subject.run!(*args) subject.run!(**args)
expect(File.exist?(path)).to be_falsey expect(File.exist?(path)).to be_falsey
expect(File.exist?(new_path)).to be_truthy expect(File.exist?(new_path)).to be_truthy
...@@ -28,13 +28,13 @@ RSpec.describe Gitlab::Cleanup::ProjectUploads do ...@@ -28,13 +28,13 @@ RSpec.describe Gitlab::Cleanup::ProjectUploads do
expect(logger).to receive(:info).with("Looking for orphaned project uploads to clean up...") expect(logger).to receive(:info).with("Looking for orphaned project uploads to clean up...")
expect(logger).to receive(:info).with("Did #{action}") expect(logger).to receive(:info).with("Did #{action}")
subject.run!(*args) subject.run!(**args)
end end
end end
shared_examples_for 'a dry run' do shared_examples_for 'a dry run' do
it 'does not move the file' do it 'does not move the file' do
subject.run!(*args) subject.run!(**args)
expect(File.exist?(path)).to be_truthy expect(File.exist?(path)).to be_truthy
expect(File.exist?(new_path)).to be_falsey expect(File.exist?(new_path)).to be_falsey
...@@ -44,7 +44,7 @@ RSpec.describe Gitlab::Cleanup::ProjectUploads do ...@@ -44,7 +44,7 @@ RSpec.describe Gitlab::Cleanup::ProjectUploads do
expect(logger).to receive(:info).with("Looking for orphaned project uploads to clean up. Dry run...") expect(logger).to receive(:info).with("Looking for orphaned project uploads to clean up. Dry run...")
expect(logger).to receive(:info).with("Can #{action}") expect(logger).to receive(:info).with("Can #{action}")
subject.run!(*args) subject.run!(**args)
end end
end end
......
...@@ -357,7 +357,7 @@ RSpec.describe Gitlab::GitalyClient::CommitService do ...@@ -357,7 +357,7 @@ RSpec.describe Gitlab::GitalyClient::CommitService do
end end
it 'sends an RPC request with the correct payload' do it 'sends an RPC request with the correct payload' do
expect(client.commits_by_message(query, options)).to match_array(wrap_commits(commits)) expect(client.commits_by_message(query, **options)).to match_array(wrap_commits(commits))
end end
end end
......
...@@ -242,7 +242,7 @@ RSpec.describe API::Ci::Runner, :clean_gitlab_redis_shared_state do ...@@ -242,7 +242,7 @@ RSpec.describe API::Ci::Runner, :clean_gitlab_redis_shared_state do
} }
expect { authorize_artifacts_with_token_in_headers(artifact_type: :lsif) } expect { authorize_artifacts_with_token_in_headers(artifact_type: :lsif) }
.to change { Gitlab::UsageDataCounters::HLLRedisCounter.unique_events(tracking_params) } .to change { Gitlab::UsageDataCounters::HLLRedisCounter.unique_events(**tracking_params) }
.by(1) .by(1)
end end
end end
......
...@@ -428,7 +428,7 @@ RSpec.describe API::GoProxy do ...@@ -428,7 +428,7 @@ RSpec.describe API::GoProxy do
context 'with a non-existent project' do context 'with a non-existent project' do
def get_resource(user = nil, **params) def get_resource(user = nil, **params)
get api("/projects/not%2fa%2fproject/packages/go/#{base}/@v/list", user, params) get api("/projects/not%2fa%2fproject/packages/go/#{base}/@v/list", user, **params)
end end
describe 'GET /projects/:id/packages/go/*module_name/@v/list' do describe 'GET /projects/:id/packages/go/*module_name/@v/list' do
...@@ -465,7 +465,7 @@ RSpec.describe API::GoProxy do ...@@ -465,7 +465,7 @@ RSpec.describe API::GoProxy do
end end
def get_resource(user = nil, headers: {}, **params) def get_resource(user = nil, headers: {}, **params)
get api("/projects/#{project.id}/packages/go/#{module_name}/@v/#{resource}", user, params), headers: headers get api("/projects/#{project.id}/packages/go/#{module_name}/@v/#{resource}", user, **params), headers: headers
end end
def fmt_pseudo_version(prefix, commit) def fmt_pseudo_version(prefix, commit)
......
...@@ -13,7 +13,7 @@ RSpec.describe EventCreateService do ...@@ -13,7 +13,7 @@ RSpec.describe EventCreateService do
tracking_params = { event_action: event_action, date_from: Date.yesterday, date_to: Date.today } tracking_params = { event_action: event_action, date_from: Date.yesterday, date_to: Date.today }
expect { subject } expect { subject }
.to change { Gitlab::UsageDataCounters::TrackUniqueEvents.count_unique_events(tracking_params) } .to change { Gitlab::UsageDataCounters::TrackUniqueEvents.count_unique_events(**tracking_params) }
.by(1) .by(1)
end end
end end
...@@ -386,7 +386,7 @@ RSpec.describe EventCreateService do ...@@ -386,7 +386,7 @@ RSpec.describe EventCreateService do
counter_class = Gitlab::UsageDataCounters::TrackUniqueEvents counter_class = Gitlab::UsageDataCounters::TrackUniqueEvents
tracking_params = { event_action: event_action, date_from: Date.yesterday, date_to: Date.today } tracking_params = { event_action: event_action, date_from: Date.yesterday, date_to: Date.today }
expect { subject }.not_to change { counter_class.count_unique_events(tracking_params) } expect { subject }.not_to change { counter_class.count_unique_events(**tracking_params) }
end end
end end
end end
......
...@@ -91,7 +91,7 @@ RSpec.describe Projects::MoveAccessService do ...@@ -91,7 +91,7 @@ RSpec.describe Projects::MoveAccessService do
it 'does not remove remaining memberships' do it 'does not remove remaining memberships' do
target_project.add_maintainer(maintainer_user) target_project.add_maintainer(maintainer_user)
subject.execute(project_with_access, options) subject.execute(project_with_access, **options)
expect(project_with_access.project_members.count).not_to eq 0 expect(project_with_access.project_members.count).not_to eq 0
end end
...@@ -99,7 +99,7 @@ RSpec.describe Projects::MoveAccessService do ...@@ -99,7 +99,7 @@ RSpec.describe Projects::MoveAccessService do
it 'does not remove remaining group links' do it 'does not remove remaining group links' do
target_project.project_group_links.create!(group: maintainer_group, group_access: Gitlab::Access::MAINTAINER) target_project.project_group_links.create!(group: maintainer_group, group_access: Gitlab::Access::MAINTAINER)
subject.execute(project_with_access, options) subject.execute(project_with_access, **options)
expect(project_with_access.project_group_links.count).not_to eq 0 expect(project_with_access.project_group_links.count).not_to eq 0
end end
...@@ -107,7 +107,7 @@ RSpec.describe Projects::MoveAccessService do ...@@ -107,7 +107,7 @@ RSpec.describe Projects::MoveAccessService do
it 'does not remove remaining authorizations' do it 'does not remove remaining authorizations' do
target_project.add_developer(developer_user) target_project.add_developer(developer_user)
subject.execute(project_with_access, options) subject.execute(project_with_access, **options)
expect(project_with_access.project_authorizations.count).not_to eq 0 expect(project_with_access.project_authorizations.count).not_to eq 0
end end
......
...@@ -51,7 +51,7 @@ RSpec.describe Projects::MoveDeployKeysProjectsService do ...@@ -51,7 +51,7 @@ RSpec.describe Projects::MoveDeployKeysProjectsService do
it 'does not remove remaining deploy keys projects' do it 'does not remove remaining deploy keys projects' do
target_project.deploy_keys << project_with_deploy_keys.deploy_keys.first target_project.deploy_keys << project_with_deploy_keys.deploy_keys.first
subject.execute(project_with_deploy_keys, options) subject.execute(project_with_deploy_keys, **options)
expect(project_with_deploy_keys.deploy_keys_projects.count).not_to eq 0 expect(project_with_deploy_keys.deploy_keys_projects.count).not_to eq 0
end end
......
...@@ -48,7 +48,7 @@ RSpec.describe Projects::MoveLfsObjectsProjectsService do ...@@ -48,7 +48,7 @@ RSpec.describe Projects::MoveLfsObjectsProjectsService do
it 'does not remove remaining lfs objects' do it 'does not remove remaining lfs objects' do
target_project.lfs_objects << project_with_lfs_objects.lfs_objects.first(2) target_project.lfs_objects << project_with_lfs_objects.lfs_objects.first(2)
subject.execute(project_with_lfs_objects, options) subject.execute(project_with_lfs_objects, **options)
expect(project_with_lfs_objects.lfs_objects.count).not_to eq 0 expect(project_with_lfs_objects.lfs_objects.count).not_to eq 0
end end
......
...@@ -49,7 +49,7 @@ RSpec.describe Projects::MoveNotificationSettingsService do ...@@ -49,7 +49,7 @@ RSpec.describe Projects::MoveNotificationSettingsService do
let(:options) { { remove_remaining_elements: false } } let(:options) { { remove_remaining_elements: false } }
it 'does not remove remaining notification settings' do it 'does not remove remaining notification settings' do
subject.execute(project_with_notifications, options) subject.execute(project_with_notifications, **options)
expect(project_with_notifications.notification_settings.count).not_to eq 0 expect(project_with_notifications.notification_settings.count).not_to eq 0
end end
......
...@@ -49,7 +49,7 @@ RSpec.describe Projects::MoveProjectAuthorizationsService do ...@@ -49,7 +49,7 @@ RSpec.describe Projects::MoveProjectAuthorizationsService do
target_project.add_maintainer(developer_user) target_project.add_maintainer(developer_user)
target_project.add_developer(reporter_user) target_project.add_developer(reporter_user)
subject.execute(project_with_users, options) subject.execute(project_with_users, **options)
expect(project_with_users.project_authorizations.count).not_to eq 0 expect(project_with_users.project_authorizations.count).not_to eq 0
end end
......
...@@ -58,7 +58,7 @@ RSpec.describe Projects::MoveProjectGroupLinksService do ...@@ -58,7 +58,7 @@ RSpec.describe Projects::MoveProjectGroupLinksService do
target_project.project_group_links.create!(group: maintainer_group, group_access: Gitlab::Access::MAINTAINER) target_project.project_group_links.create!(group: maintainer_group, group_access: Gitlab::Access::MAINTAINER)
target_project.project_group_links.create!(group: developer_group, group_access: Gitlab::Access::DEVELOPER) target_project.project_group_links.create!(group: developer_group, group_access: Gitlab::Access::DEVELOPER)
subject.execute(project_with_groups, options) subject.execute(project_with_groups, **options)
expect(project_with_groups.project_group_links.count).not_to eq 0 expect(project_with_groups.project_group_links.count).not_to eq 0
end end
......
...@@ -58,7 +58,7 @@ RSpec.describe Projects::MoveProjectMembersService do ...@@ -58,7 +58,7 @@ RSpec.describe Projects::MoveProjectMembersService do
target_project.add_maintainer(developer_user) target_project.add_maintainer(developer_user)
target_project.add_developer(reporter_user) target_project.add_developer(reporter_user)
subject.execute(project_with_users, options) subject.execute(project_with_users, **options)
expect(project_with_users.project_members.count).not_to eq 0 expect(project_with_users.project_members.count).not_to eq 0
end end
......
...@@ -20,7 +20,7 @@ RSpec.describe Suggestions::ApplyService do ...@@ -20,7 +20,7 @@ RSpec.describe Suggestions::ApplyService do
position_args = args.slice(:old_path, :new_path, :old_line, :new_line) position_args = args.slice(:old_path, :new_path, :old_line, :new_line)
content_args = args.slice(:from_content, :to_content) content_args = args.slice(:from_content, :to_content)
position = build_position(position_args) position = build_position(**position_args)
diff_note = create(:diff_note_on_merge_request, diff_note = create(:diff_note_on_merge_request,
noteable: merge_request, noteable: merge_request,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment