diff options
author | ThibG <thib@sitedethib.com> | 2019-10-01 15:10:00 +0200 |
---|---|---|
committer | Eugen Rochko <eugen@zeonfederated.com> | 2019-10-01 15:10:00 +0200 |
commit | 3a4d994c40962a9abe45565a34e3d7a3ca1ccd49 (patch) | |
tree | 74ca14f8ddc1b4ef9609dfb28b1fac60c6e3c339 /spec | |
parent | 541269f8bcb575501215b6694924075d696b710b (diff) |
Fix BootstrapTimelineService crashing when bootstrapped accounts are invalid (#12037)
* Add test to handle suspended and missing users in BootstrapTimelineService * Fix BootstrapTimelineService crashing when bootstrapped accounts are invalid
Diffstat (limited to 'spec')
-rw-r--r-- | spec/services/bootstrap_timeline_service_spec.rb | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/spec/services/bootstrap_timeline_service_spec.rb b/spec/services/bootstrap_timeline_service_spec.rb index a765de791..a28d2407c 100644 --- a/spec/services/bootstrap_timeline_service_spec.rb +++ b/spec/services/bootstrap_timeline_service_spec.rb @@ -22,9 +22,10 @@ RSpec.describe BootstrapTimelineService, type: :service do context 'when setting is set' do let!(:alice) { Fabricate(:account, username: 'alice') } let!(:bob) { Fabricate(:account, username: 'bob') } + let!(:eve) { Fabricate(:account, username: 'eve', suspended: true) } before do - Setting.bootstrap_timeline_accounts = 'alice, bob' + Setting.bootstrap_timeline_accounts = 'alice, @bob, eve, unknown' subject.call(source_account) end @@ -32,6 +33,10 @@ RSpec.describe BootstrapTimelineService, type: :service do expect(source_account.following?(alice)).to be true expect(source_account.following?(bob)).to be true end + + it 'does not follow suspended account' do + expect(source_account.following?(eve)).to be false + end end end end |