Fix ruby specs

This commit is contained in:
nachtjasmin 2023-12-27 22:07:28 +01:00
parent 17a4311617
commit aa986fb619
No known key found for this signature in database
2 changed files with 12 additions and 12 deletions

View File

@ -60,9 +60,9 @@ describe TagFeed, type: :service do
end
it 'excludes local-only posts when specified' do
status1.update(local_only: true)
results = described_class.new(tag1, nil, any: [tag2.name], without_local_only: true).get(20)
expect(results).to_not include status1
status_tagged_with_cats.update(local_only: true)
results = described_class.new(tag_cats, nil, any: [tag_dogs.name], without_local_only: true).get(20)
expect(results).to_not include status_tagged_with_cats
end
it 'allows replies to be included' do

View File

@ -84,18 +84,18 @@ RSpec.describe StatusPolicy, type: :model do
expect(subject).to_not permit(viewer, status)
end
end
it 'denies access when local-only and the viewer is not logged in' do
allow(status).to receive(:local_only?).and_return(true)
it 'denies access when local-only and the viewer is not logged in' do
allow(status).to receive(:local_only?).and_return(true)
expect(subject).to_not permit(nil, status)
end
expect(subject).to_not permit(nil, status)
end
it 'denies access when local-only and the viewer is from another domain' do
viewer = Fabricate(:account, domain: 'remote-domain')
allow(status).to receive(:local_only?).and_return(true)
expect(subject).to_not permit(viewer, status)
it 'denies access when local-only and the viewer is from another domain' do
viewer = Fabricate(:account, domain: 'remote-domain')
allow(status).to receive(:local_only?).and_return(true)
expect(subject).to_not permit(viewer, status)
end
end
end