Fix RSpec/SharedContext cop (#24847)
This commit is contained in:
parent
5241f7b2fd
commit
bf3ebeb42f
2 changed files with 3 additions and 8 deletions
|
@ -648,11 +648,6 @@ RSpec/RepeatedExampleGroupDescription:
|
||||||
- 'spec/controllers/admin/reports/actions_controller_spec.rb'
|
- 'spec/controllers/admin/reports/actions_controller_spec.rb'
|
||||||
- 'spec/policies/report_note_policy_spec.rb'
|
- 'spec/policies/report_note_policy_spec.rb'
|
||||||
|
|
||||||
# This cop supports safe autocorrection (--autocorrect).
|
|
||||||
RSpec/SharedContext:
|
|
||||||
Exclude:
|
|
||||||
- 'spec/services/unsuspend_account_service_spec.rb'
|
|
||||||
|
|
||||||
RSpec/StubbedMock:
|
RSpec/StubbedMock:
|
||||||
Exclude:
|
Exclude:
|
||||||
- 'spec/controllers/api/base_controller_spec.rb'
|
- 'spec/controllers/api/base_controller_spec.rb'
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
require 'rails_helper'
|
require 'rails_helper'
|
||||||
|
|
||||||
RSpec.describe UnsuspendAccountService, type: :service do
|
RSpec.describe UnsuspendAccountService, type: :service do
|
||||||
shared_examples 'common behavior' do
|
shared_context 'with common context' do
|
||||||
subject { described_class.new.call(account) }
|
subject { described_class.new.call(account) }
|
||||||
|
|
||||||
let!(:local_follower) { Fabricate(:user, current_sign_in_at: 1.hour.ago).account }
|
let!(:local_follower) { Fabricate(:user, current_sign_in_at: 1.hour.ago).account }
|
||||||
|
@ -36,7 +36,7 @@ RSpec.describe UnsuspendAccountService, type: :service do
|
||||||
expect { subject }.to_not change { account.suspended? }
|
expect { subject }.to_not change { account.suspended? }
|
||||||
end
|
end
|
||||||
|
|
||||||
include_examples 'common behavior' do
|
include_examples 'with common context' do
|
||||||
let!(:account) { Fabricate(:account) }
|
let!(:account) { Fabricate(:account) }
|
||||||
let!(:remote_follower) { Fabricate(:account, uri: 'https://alice.com', inbox_url: 'https://alice.com/inbox', protocol: :activitypub) }
|
let!(:remote_follower) { Fabricate(:account, uri: 'https://alice.com', inbox_url: 'https://alice.com/inbox', protocol: :activitypub) }
|
||||||
let!(:remote_reporter) { Fabricate(:account, uri: 'https://bob.com', inbox_url: 'https://bob.com/inbox', protocol: :activitypub) }
|
let!(:remote_reporter) { Fabricate(:account, uri: 'https://bob.com', inbox_url: 'https://bob.com/inbox', protocol: :activitypub) }
|
||||||
|
@ -61,7 +61,7 @@ RSpec.describe UnsuspendAccountService, type: :service do
|
||||||
end
|
end
|
||||||
|
|
||||||
describe 'unsuspending a remote account' do
|
describe 'unsuspending a remote account' do
|
||||||
include_examples 'common behavior' do
|
include_examples 'with common context' do
|
||||||
let!(:account) { Fabricate(:account, domain: 'bob.com', uri: 'https://bob.com', inbox_url: 'https://bob.com/inbox', protocol: :activitypub) }
|
let!(:account) { Fabricate(:account, domain: 'bob.com', uri: 'https://bob.com', inbox_url: 'https://bob.com/inbox', protocol: :activitypub) }
|
||||||
let!(:resolve_account_service) { double }
|
let!(:resolve_account_service) { double }
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue