logo

mastofe

My custom branche(s) on git.pleroma.social/pleroma/mastofe git clone https://hacktivis.me/git/mastofe.git

bootstrap_timeline_service_spec.rb (997B)


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