blob: a765de79127baf61314f396a6af3679066a48c98 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
require 'rails_helper'
RSpec.describe BootstrapTimelineService, type: :service do
subject { described_class.new }
describe '#call' do
let(:source_account) { Fabricate(:account) }
context 'when setting is empty' do
let!(:admin) { Fabricate(:user, admin: true) }
before do
Setting.bootstrap_timeline_accounts = nil
subject.call(source_account)
end
it 'follows admin accounts from account' do
expect(source_account.following?(admin.account)).to be true
end
end
context 'when setting is set' do
let!(:alice) { Fabricate(:account, username: 'alice') }
let!(:bob) { Fabricate(:account, username: 'bob') }
before do
Setting.bootstrap_timeline_accounts = 'alice, bob'
subject.call(source_account)
end
it 'follows found accounts from account' do
expect(source_account.following?(alice)).to be true
expect(source_account.following?(bob)).to be true
end
end
end
end
|