Commit b53c6d07 authored by Jan Provaznik's avatar Jan Provaznik

Merge branch 'fix_next_instance_of_kwarg' into 'master'

[RUN AS-IF-FOSS]  Fix some keyword warnings in specs

See merge request gitlab-org/gitlab!48640
parents 6e834308 b3333dea
...@@ -33,7 +33,7 @@ RSpec.describe Mutations::Issues::Update do ...@@ -33,7 +33,7 @@ RSpec.describe Mutations::Issues::Update do
}.merge(expected_attributes) }.merge(expected_attributes)
end end
subject { mutation.resolve(mutation_params) } subject { mutation.resolve(**mutation_params) }
it_behaves_like 'permission level for issue mutation is correctly verified' it_behaves_like 'permission level for issue mutation is correctly verified'
......
...@@ -242,7 +242,9 @@ RSpec.describe Backup::Repositories do ...@@ -242,7 +242,9 @@ RSpec.describe Backup::Repositories do
# 4 times = project repo + wiki repo + project_snippet repo + personal_snippet repo # 4 times = project repo + wiki repo + project_snippet repo + personal_snippet repo
expect(Repository).to receive(:new).exactly(4).times.and_wrap_original do |method, *original_args| expect(Repository).to receive(:new).exactly(4).times.and_wrap_original do |method, *original_args|
repository = method.call(*original_args) full_path, container, kwargs = original_args
repository = method.call(full_path, container, **kwargs)
expect(repository).to receive(:remove) expect(repository).to receive(:remove)
......
...@@ -12,23 +12,23 @@ RSpec.describe Members::ApproveAccessRequestService do ...@@ -12,23 +12,23 @@ RSpec.describe Members::ApproveAccessRequestService do
shared_examples 'a service raising ActiveRecord::RecordNotFound' do shared_examples 'a service raising ActiveRecord::RecordNotFound' do
it 'raises ActiveRecord::RecordNotFound' do it 'raises ActiveRecord::RecordNotFound' do
expect { described_class.new(current_user).execute(access_requester, opts) }.to raise_error(ActiveRecord::RecordNotFound) expect { described_class.new(current_user).execute(access_requester, **opts) }.to raise_error(ActiveRecord::RecordNotFound)
end end
end end
shared_examples 'a service raising Gitlab::Access::AccessDeniedError' do shared_examples 'a service raising Gitlab::Access::AccessDeniedError' do
it 'raises Gitlab::Access::AccessDeniedError' do it 'raises Gitlab::Access::AccessDeniedError' do
expect { described_class.new(current_user).execute(access_requester, opts) }.to raise_error(Gitlab::Access::AccessDeniedError) expect { described_class.new(current_user).execute(access_requester, **opts) }.to raise_error(Gitlab::Access::AccessDeniedError)
end end
end end
shared_examples 'a service approving an access request' do shared_examples 'a service approving an access request' do
it 'succeeds' do it 'succeeds' do
expect { described_class.new(current_user).execute(access_requester, opts) }.to change { source.requesters.count }.by(-1) expect { described_class.new(current_user).execute(access_requester, **opts) }.to change { source.requesters.count }.by(-1)
end end
it 'returns a <Source>Member' do it 'returns a <Source>Member' do
member = described_class.new(current_user).execute(access_requester, opts) member = described_class.new(current_user).execute(access_requester, **opts)
expect(member).to be_a "#{source.class}Member".constantize expect(member).to be_a "#{source.class}Member".constantize
expect(member.requested_at).to be_nil expect(member.requested_at).to be_nil
...@@ -36,7 +36,7 @@ RSpec.describe Members::ApproveAccessRequestService do ...@@ -36,7 +36,7 @@ RSpec.describe Members::ApproveAccessRequestService do
context 'with a custom access level' do context 'with a custom access level' do
it 'returns a ProjectMember with the custom access level' do it 'returns a ProjectMember with the custom access level' do
member = described_class.new(current_user, access_level: Gitlab::Access::MAINTAINER).execute(access_requester, opts) member = described_class.new(current_user, access_level: Gitlab::Access::MAINTAINER).execute(access_requester, **opts)
expect(member.access_level).to eq(Gitlab::Access::MAINTAINER) expect(member.access_level).to eq(Gitlab::Access::MAINTAINER)
end end
......
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