Merge remote-tracking branch 'parent/main' into upstream-20231109
This commit is contained in:
commit
fc1b280d59
65 changed files with 18502 additions and 13905 deletions
|
@ -209,15 +209,13 @@ RSpec.describe PublicFeed do
|
|||
end
|
||||
|
||||
describe 'with an account passed in' do
|
||||
subject { described_class.new(@account).get(20).map(&:id) }
|
||||
subject { described_class.new(account).get(20).map(&:id) }
|
||||
|
||||
before do
|
||||
@account = Fabricate(:account)
|
||||
end
|
||||
let!(:account) { Fabricate(:account) }
|
||||
|
||||
it 'excludes statuses from accounts blocked by the account' do
|
||||
blocked = Fabricate(:account)
|
||||
@account.block!(blocked)
|
||||
account.block!(blocked)
|
||||
blocked_status = Fabricate(:status, account: blocked)
|
||||
|
||||
expect(subject).to_not include(blocked_status.id)
|
||||
|
@ -225,7 +223,7 @@ RSpec.describe PublicFeed do
|
|||
|
||||
it 'excludes statuses from accounts who have blocked the account' do
|
||||
blocker = Fabricate(:account)
|
||||
blocker.block!(@account)
|
||||
blocker.block!(account)
|
||||
blocked_status = Fabricate(:status, account: blocker)
|
||||
|
||||
expect(subject).to_not include(blocked_status.id)
|
||||
|
@ -233,7 +231,7 @@ RSpec.describe PublicFeed do
|
|||
|
||||
it 'excludes statuses from accounts muted by the account' do
|
||||
muted = Fabricate(:account)
|
||||
@account.mute!(muted)
|
||||
account.mute!(muted)
|
||||
muted_status = Fabricate(:status, account: muted)
|
||||
|
||||
expect(subject).to_not include(muted_status.id)
|
||||
|
@ -241,7 +239,7 @@ RSpec.describe PublicFeed do
|
|||
|
||||
it 'excludes statuses from accounts from personally blocked domains' do
|
||||
blocked = Fabricate(:account, domain: 'example.com')
|
||||
@account.block_domain!(blocked.domain)
|
||||
account.block_domain!(blocked.domain)
|
||||
blocked_status = Fabricate(:status, account: blocked)
|
||||
|
||||
expect(subject).to_not include(blocked_status.id)
|
||||
|
@ -249,7 +247,7 @@ RSpec.describe PublicFeed do
|
|||
|
||||
context 'with language preferences' do
|
||||
it 'excludes statuses in languages not allowed by the account user' do
|
||||
@account.user.update(chosen_languages: [:en, :es])
|
||||
account.user.update(chosen_languages: [:en, :es])
|
||||
en_status = Fabricate(:status, language: 'en')
|
||||
es_status = Fabricate(:status, language: 'es')
|
||||
fr_status = Fabricate(:status, language: 'fr')
|
||||
|
@ -260,7 +258,7 @@ RSpec.describe PublicFeed do
|
|||
end
|
||||
|
||||
it 'includes all languages when user does not have a setting' do
|
||||
@account.user.update(chosen_languages: nil)
|
||||
account.user.update(chosen_languages: nil)
|
||||
|
||||
en_status = Fabricate(:status, language: 'en')
|
||||
es_status = Fabricate(:status, language: 'es')
|
||||
|
@ -270,7 +268,7 @@ RSpec.describe PublicFeed do
|
|||
end
|
||||
|
||||
it 'includes all languages when account does not have a user' do
|
||||
@account.update(user: nil)
|
||||
account.update(user: nil)
|
||||
|
||||
en_status = Fabricate(:status, language: 'en')
|
||||
es_status = Fabricate(:status, language: 'es')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue