From aa986fb619c29742849f5dab2dea24a56f68bbe6 Mon Sep 17 00:00:00 2001 From: nachtjasmin Date: Wed, 27 Dec 2023 22:07:28 +0100 Subject: [PATCH] Fix ruby specs --- spec/models/tag_feed_spec.rb | 6 +++--- spec/policies/status_policy_spec.rb | 18 +++++++++--------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/spec/models/tag_feed_spec.rb b/spec/models/tag_feed_spec.rb index 225d6c976..f3e6da074 100644 --- a/spec/models/tag_feed_spec.rb +++ b/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 diff --git a/spec/policies/status_policy_spec.rb b/spec/policies/status_policy_spec.rb index a278bb4e8..725bd0bbb 100644 --- a/spec/policies/status_policy_spec.rb +++ b/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