mirror of
https://github.com/mastodon/mastodon.git
synced 2026-03-21 18:05:23 -05:00
Use to_json call for pins API (#38231)
This commit is contained in:
parent
968ce25c39
commit
092acbd47b
|
|
@ -30,7 +30,7 @@ class Api::V1::Statuses::PinsController < Api::V1::Statuses::BaseController
|
|||
adapter: ActivityPub::Adapter
|
||||
).as_json
|
||||
|
||||
ActivityPub::RawDistributionWorker.perform_async(Oj.dump(json), current_account.id)
|
||||
ActivityPub::RawDistributionWorker.perform_async(json.to_json, current_account.id)
|
||||
end
|
||||
|
||||
def distribute_remove_activity!
|
||||
|
|
@ -40,6 +40,6 @@ class Api::V1::Statuses::PinsController < Api::V1::Statuses::BaseController
|
|||
adapter: ActivityPub::Adapter
|
||||
).as_json
|
||||
|
||||
ActivityPub::RawDistributionWorker.perform_async(Oj.dump(json), current_account.id)
|
||||
ActivityPub::RawDistributionWorker.perform_async(json.to_json, current_account.id)
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -29,6 +29,8 @@ RSpec.describe 'Pins' do
|
|||
expect(response.parsed_body).to match(
|
||||
a_hash_including(id: status.id.to_s, pinned: true)
|
||||
)
|
||||
expect(ActivityPub::RawDistributionWorker)
|
||||
.to have_enqueued_sidekiq_job(match_json_values(type: 'Add'), user.account.id)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
@ -118,6 +120,8 @@ RSpec.describe 'Pins' do
|
|||
expect(response.parsed_body).to match(
|
||||
a_hash_including(id: status.id.to_s, pinned: false)
|
||||
)
|
||||
expect(ActivityPub::RawDistributionWorker)
|
||||
.to have_enqueued_sidekiq_job(match_json_values(type: 'Remove'), user.account.id)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user