mirror of
https://github.com/mastodon/mastodon.git
synced 2024-11-23 13:05:12 +01:00
cb5b5cb5f7
* No need to re-require sidekiq plugins, they are required via Gemfile * Add derailed_benchmarks tool, no need to require TTY gems in Gemfile * Replace ruby-oembed with FetchOEmbedService Reduce startup by 45382 allocated objects * Remove preloaded JSON-LD in favour of caching HTTP responses Reduce boot RAM by about 6 MiB * Fix tests * Fix test suite by stubbing out JSON-LD contexts
38 lines
1013 B
Ruby
38 lines
1013 B
Ruby
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
|