|
664 | 664 | end |
665 | 665 | end |
666 | 666 | end |
| 667 | + |
| 668 | + context 'with with_reblogs true' do |
| 669 | + subject { described_class.new(viewer, with_reblogs: true).get(20).map(&:id) } |
| 670 | + |
| 671 | + let!(:viewer) { Fabricate(:account, domain: nil) } |
| 672 | + let!(:booster) { Fabricate(:account, domain: nil) } |
| 673 | + let!(:boosted) { Fabricate(:account, domain: nil) } |
| 674 | + let!(:status) { Fabricate(:status, account: boosted) } |
| 675 | + let!(:boost) { Fabricate(:status, account: booster, reblog_of_id: status.id) } |
| 676 | + |
| 677 | + shared_examples 'shows boost' do |
| 678 | + it 'shows boosts in public feeds' do |
| 679 | + expect(subject).to include(boost.id) |
| 680 | + end |
| 681 | + end |
| 682 | + |
| 683 | + shared_examples 'does not show boost' do |
| 684 | + it 'does not show boosts in public feeds' do |
| 685 | + expect(subject).to_not include(boost.id) |
| 686 | + end |
| 687 | + end |
| 688 | + |
| 689 | + it_behaves_like 'shows boost' |
| 690 | + |
| 691 | + context 'with a local_only option set' do |
| 692 | + subject { described_class.new(viewer, with_reblogs: true, local: true).get(20).map(&:id) } |
| 693 | + |
| 694 | + context 'with a remote booster' do |
| 695 | + let!(:booster) { Fabricate(:account, domain: 'other.net') } |
| 696 | + |
| 697 | + it_behaves_like 'does not show boost' |
| 698 | + end |
| 699 | + |
| 700 | + context 'with a remote status' do |
| 701 | + let!(:boosted) { Fabricate(:account, domain: 'other.net') } |
| 702 | + |
| 703 | + it_behaves_like 'shows boost' |
| 704 | + |
| 705 | + context 'with a remote booster' do |
| 706 | + let!(:booster) { Fabricate(:account, domain: 'other.net') } |
| 707 | + |
| 708 | + it_behaves_like 'does not show boost' |
| 709 | + end |
| 710 | + end |
| 711 | + |
| 712 | + context 'when hiding boosts from a followed account' do |
| 713 | + before do |
| 714 | + Fabricate(:follow, account: viewer, target_account: booster, show_reblogs: false) |
| 715 | + end |
| 716 | + |
| 717 | + it_behaves_like 'does not show boost' |
| 718 | + end |
| 719 | + end |
| 720 | + end |
667 | 721 | end |
668 | 722 | end |
0 commit comments