about summary refs log tree commit diff
path: root/spec/models/status_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/models/status_spec.rb')
-rw-r--r--spec/models/status_spec.rb235
1 files changed, 0 insertions, 235 deletions
diff --git a/spec/models/status_spec.rb b/spec/models/status_spec.rb
index 4aee14cbd..20fb894e7 100644
--- a/spec/models/status_spec.rb
+++ b/spec/models/status_spec.rb
@@ -267,241 +267,6 @@ RSpec.describe Status, type: :model do
     end
   end
 
-  describe '.as_public_timeline' do
-    it 'only includes statuses with public visibility' do
-      public_status = Fabricate(:status, visibility: :public)
-      private_status = Fabricate(:status, visibility: :private)
-
-      results = Status.as_public_timeline
-      expect(results).to include(public_status)
-      expect(results).not_to include(private_status)
-    end
-
-    it 'does not include replies' do
-      status = Fabricate(:status)
-      reply = Fabricate(:status, in_reply_to_id: status.id)
-
-      results = Status.as_public_timeline
-      expect(results).to include(status)
-      expect(results).not_to include(reply)
-    end
-
-    it 'does not include boosts' do
-      status = Fabricate(:status)
-      boost = Fabricate(:status, reblog_of_id: status.id)
-
-      results = Status.as_public_timeline
-      expect(results).to include(status)
-      expect(results).not_to include(boost)
-    end
-
-    it 'filters out silenced accounts' do
-      account = Fabricate(:account)
-      silenced_account = Fabricate(:account, silenced: true)
-      status = Fabricate(:status, account: account)
-      silenced_status = Fabricate(:status, account: silenced_account)
-
-      results = Status.as_public_timeline
-      expect(results).to include(status)
-      expect(results).not_to include(silenced_status)
-    end
-
-    context 'without local_only option' do
-      let(:viewer) { nil }
-
-      let!(:local_account)  { Fabricate(:account, domain: nil) }
-      let!(:remote_account) { Fabricate(:account, domain: 'test.com') }
-      let!(:local_status)   { Fabricate(:status, account: local_account) }
-      let!(:remote_status)  { Fabricate(:status, account: remote_account) }
-
-      subject { Status.as_public_timeline(viewer, false) }
-
-      context 'without a viewer' do
-        let(:viewer) { nil }
-
-        it 'includes remote instances statuses' do
-          expect(subject).to include(remote_status)
-        end
-
-        it 'includes local statuses' do
-          expect(subject).to include(local_status)
-        end
-      end
-
-      context 'with a viewer' do
-        let(:viewer) { Fabricate(:account, username: 'viewer') }
-
-        it 'includes remote instances statuses' do
-          expect(subject).to include(remote_status)
-        end
-
-        it 'includes local statuses' do
-          expect(subject).to include(local_status)
-        end
-      end
-    end
-
-    context 'with a local_only option set' do
-      let!(:local_account)  { Fabricate(:account, domain: nil) }
-      let!(:remote_account) { Fabricate(:account, domain: 'test.com') }
-      let!(:local_status)   { Fabricate(:status, account: local_account) }
-      let!(:remote_status)  { Fabricate(:status, account: remote_account) }
-
-      subject { Status.as_public_timeline(viewer, true) }
-
-      context 'without a viewer' do
-        let(:viewer) { nil }
-
-        it 'does not include remote instances statuses' do
-          expect(subject).to include(local_status)
-          expect(subject).not_to include(remote_status)
-        end
-      end
-
-      context 'with a viewer' do
-        let(:viewer) { Fabricate(:account, username: 'viewer') }
-
-        it 'does not include remote instances statuses' do
-          expect(subject).to include(local_status)
-          expect(subject).not_to include(remote_status)
-        end
-
-        it 'is not affected by personal domain blocks' do
-          viewer.block_domain!('test.com')
-          expect(subject).to include(local_status)
-          expect(subject).not_to include(remote_status)
-        end
-      end
-    end
-
-    context 'with a remote_only option set' do
-      let!(:local_account)  { Fabricate(:account, domain: nil) }
-      let!(:remote_account) { Fabricate(:account, domain: 'test.com') }
-      let!(:local_status)   { Fabricate(:status, account: local_account) }
-      let!(:remote_status)  { Fabricate(:status, account: remote_account) }
-
-      subject { Status.as_public_timeline(viewer, :remote) }
-
-      context 'without a viewer' do
-        let(:viewer) { nil }
-
-        it 'does not include local instances statuses' do
-          expect(subject).not_to include(local_status)
-          expect(subject).to include(remote_status)
-        end
-      end
-
-      context 'with a viewer' do
-        let(:viewer) { Fabricate(:account, username: 'viewer') }
-
-        it 'does not include local instances statuses' do
-          expect(subject).not_to include(local_status)
-          expect(subject).to include(remote_status)
-        end
-      end
-    end
-
-    describe 'with an account passed in' do
-      before do
-        @account = Fabricate(:account)
-      end
-
-      it 'excludes statuses from accounts blocked by the account' do
-        blocked = Fabricate(:account)
-        Fabricate(:block, account: @account, target_account: blocked)
-        blocked_status = Fabricate(:status, account: blocked)
-
-        results = Status.as_public_timeline(@account)
-        expect(results).not_to include(blocked_status)
-      end
-
-      it 'excludes statuses from accounts who have blocked the account' do
-        blocked = Fabricate(:account)
-        Fabricate(:block, account: blocked, target_account: @account)
-        blocked_status = Fabricate(:status, account: blocked)
-
-        results = Status.as_public_timeline(@account)
-        expect(results).not_to include(blocked_status)
-      end
-
-      it 'excludes statuses from accounts muted by the account' do
-        muted = Fabricate(:account)
-        Fabricate(:mute, account: @account, target_account: muted)
-        muted_status = Fabricate(:status, account: muted)
-
-        results = Status.as_public_timeline(@account)
-        expect(results).not_to include(muted_status)
-      end
-
-      it 'excludes statuses from accounts from personally blocked domains' do
-        blocked = Fabricate(:account, domain: 'example.com')
-        @account.block_domain!(blocked.domain)
-        blocked_status = Fabricate(:status, account: blocked)
-
-        results = Status.as_public_timeline(@account)
-        expect(results).not_to include(blocked_status)
-      end
-
-      context 'with language preferences' do
-        it 'excludes statuses in languages not allowed by the account user' do
-          user = Fabricate(:user, chosen_languages: [:en, :es])
-          @account.update(user: user)
-          en_status = Fabricate(:status, language: 'en')
-          es_status = Fabricate(:status, language: 'es')
-          fr_status = Fabricate(:status, language: 'fr')
-
-          results = Status.as_public_timeline(@account)
-          expect(results).to include(en_status)
-          expect(results).to include(es_status)
-          expect(results).not_to include(fr_status)
-        end
-
-        it 'includes all languages when user does not have a setting' do
-          user = Fabricate(:user, chosen_languages: nil)
-          @account.update(user: user)
-
-          en_status = Fabricate(:status, language: 'en')
-          es_status = Fabricate(:status, language: 'es')
-
-          results = Status.as_public_timeline(@account)
-          expect(results).to include(en_status)
-          expect(results).to include(es_status)
-        end
-
-        it 'includes all languages when account does not have a user' do
-          expect(@account.user).to be_nil
-          en_status = Fabricate(:status, language: 'en')
-          es_status = Fabricate(:status, language: 'es')
-
-          results = Status.as_public_timeline(@account)
-          expect(results).to include(en_status)
-          expect(results).to include(es_status)
-        end
-      end
-    end
-  end
-
-  describe '.as_tag_timeline' do
-    it 'includes statuses with a tag' do
-      tag = Fabricate(:tag)
-      status = Fabricate(:status, tags: [tag])
-      other = Fabricate(:status)
-
-      results = Status.as_tag_timeline(tag)
-      expect(results).to include(status)
-      expect(results).not_to include(other)
-    end
-
-    it 'allows replies to be included' do
-      original = Fabricate(:status)
-      tag = Fabricate(:tag)
-      status = Fabricate(:status, tags: [tag], in_reply_to_id: original.id)
-
-      results = Status.as_tag_timeline(tag)
-      expect(results).to include(status)
-    end
-  end
-
   describe '.permitted_for' do
     subject { described_class.permitted_for(target_account, account).pluck(:visibility) }