Autofix Rubocops RSpec/ScatteredLet (#23725)
This commit is contained in:
parent
aef0051fd0
commit
5179c47087
9 changed files with 56 additions and 83 deletions
|
@ -183,15 +183,14 @@ RSpec.describe ImportService, type: :service do
|
|||
subject { ImportService.new }
|
||||
|
||||
let!(:nare) { Fabricate(:account, username: 'nare', domain: 'թութ.հայ', locked: false, protocol: :activitypub, inbox_url: 'https://թութ.հայ/inbox') }
|
||||
let(:csv) { attachment_fixture('utf8-followers.txt') }
|
||||
let(:import) { Import.create(account: account, type: 'following', data: csv) }
|
||||
|
||||
# Make sure to not actually go to the remote server
|
||||
before do
|
||||
stub_request(:post, 'https://թութ.հայ/inbox').to_return(status: 200)
|
||||
end
|
||||
|
||||
let(:csv) { attachment_fixture('utf8-followers.txt') }
|
||||
let(:import) { Import.create(account: account, type: 'following', data: csv) }
|
||||
|
||||
it 'follows the listed account' do
|
||||
expect(account.follow_requests.count).to eq 0
|
||||
subject.call(import)
|
||||
|
@ -203,6 +202,9 @@ RSpec.describe ImportService, type: :service do
|
|||
subject { ImportService.new }
|
||||
|
||||
let(:csv) { attachment_fixture('bookmark-imports.txt') }
|
||||
let(:local_account) { Fabricate(:account, username: 'foo', domain: '') }
|
||||
let!(:remote_status) { Fabricate(:status, uri: 'https://example.com/statuses/1312') }
|
||||
let!(:direct_status) { Fabricate(:status, uri: 'https://example.com/statuses/direct', visibility: :direct) }
|
||||
|
||||
around(:each) do |example|
|
||||
local_before = Rails.configuration.x.local_domain
|
||||
|
@ -214,10 +216,6 @@ RSpec.describe ImportService, type: :service do
|
|||
Rails.configuration.x.local_domain = local_before
|
||||
end
|
||||
|
||||
let(:local_account) { Fabricate(:account, username: 'foo', domain: '') }
|
||||
let!(:remote_status) { Fabricate(:status, uri: 'https://example.com/statuses/1312') }
|
||||
let!(:direct_status) { Fabricate(:status, uri: 'https://example.com/statuses/direct', visibility: :direct) }
|
||||
|
||||
before do
|
||||
service = double
|
||||
allow(ActivityPub::FetchRemoteStatusService).to receive(:new).and_return(service)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue