Commit b3333dea authored by Thong Kuah's avatar Thong Kuah

Fix some keyword warnings in specs

parent 40f82832
...@@ -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