logo

mastofe

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

after_block_service_spec.rb (887B)


  1. require 'rails_helper'
  2. RSpec.describe AfterBlockService do
  3. subject do
  4. -> { described_class.new.call(account, target_account) }
  5. end
  6. let(:account) { Fabricate(:account) }
  7. let(:target_account) { Fabricate(:account) }
  8. describe 'home timeline' do
  9. let(:status) { Fabricate(:status, account: target_account) }
  10. let(:other_account_status) { Fabricate(:status) }
  11. let(:home_timeline_key) { FeedManager.instance.key(:home, account.id) }
  12. before do
  13. Redis.current.del(home_timeline_key)
  14. end
  15. it "clears account's statuses" do
  16. FeedManager.instance.push_to_home(account, status)
  17. FeedManager.instance.push_to_home(account, other_account_status)
  18. is_expected.to change {
  19. Redis.current.zrange(home_timeline_key, 0, -1)
  20. }.from([status.id.to_s, other_account_status.id.to_s]).to([other_account_status.id.to_s])
  21. end
  22. end
  23. end