Add REST API for featuring and unfeaturing a hashtag (#34489)
Co-authored-by: Matt Jankowski <matt@jankowski.online> Co-authored-by: Claire <claire.github-309c@sitedethib.com>
This commit is contained in:
parent
49b6a49c76
commit
a97647158c
15 changed files with 195 additions and 50 deletions
|
@ -20,11 +20,9 @@ RSpec.describe CreateFeaturedTagService do
|
|||
context 'with a remote account' do
|
||||
let(:account) { Fabricate(:account, domain: 'host.example') }
|
||||
|
||||
it 'creates a new featured tag and does not distributes' do
|
||||
it 'raises argument error' do
|
||||
expect { subject.call(account, tag) }
|
||||
.to change(FeaturedTag, :count).by(1)
|
||||
expect(ActivityPub::AccountRawDistributionWorker)
|
||||
.to_not have_enqueued_sidekiq_job(any_args)
|
||||
.to raise_error ArgumentError
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -23,13 +23,9 @@ RSpec.describe RemoveFeaturedTagService do
|
|||
context 'when called by a non local account' do
|
||||
let(:account) { Fabricate(:account, domain: 'host.example') }
|
||||
|
||||
it 'destroys the featured tag and does not send a distribution' do
|
||||
subject.call(account, featured_tag)
|
||||
|
||||
expect { featured_tag.reload }
|
||||
.to raise_error(ActiveRecord::RecordNotFound)
|
||||
expect(ActivityPub::AccountRawDistributionWorker)
|
||||
.to_not have_enqueued_sidekiq_job(any_args)
|
||||
it 'raises argument error' do
|
||||
expect { subject.call(account, featured_tag) }
|
||||
.to raise_error(ArgumentError)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue