1
0
Fork 0
forked from gitea/nas

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:
Eugen Rochko 2025-04-25 17:12:05 +02:00 committed by GitHub
parent 49b6a49c76
commit a97647158c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
15 changed files with 195 additions and 50 deletions

View file

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

View file

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