Browse Source

Fix ruby specs

lets-bump-hometown-to-mastodon-4.2
nachtjasmin 2 years ago
parent
commit
ca313dd4fe
No known key found for this signature in database
  1. 6
      spec/models/tag_feed_spec.rb
  2. 18
      spec/policies/status_policy_spec.rb

6
spec/models/tag_feed_spec.rb

@ -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

18
spec/policies/status_policy_spec.rb

@ -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

Loading…
Cancel
Save