mirror of
https://github.com/mastodon/mastodon.git
synced 2024-12-22 07:05:23 +01:00
Fix application_id
erroneous inclusion in ScheduledStatusSerializer
(#33159)
This commit is contained in:
parent
3ac478472e
commit
a7673d361d
2 changed files with 11 additions and 4 deletions
|
@ -10,6 +10,6 @@ class REST::ScheduledStatusSerializer < ActiveModel::Serializer
|
|||
end
|
||||
|
||||
def params
|
||||
object.params.without(:application_id)
|
||||
object.params.without('application_id')
|
||||
end
|
||||
end
|
||||
|
|
|
@ -11,11 +11,18 @@ RSpec.describe REST::ScheduledStatusSerializer do
|
|||
end
|
||||
|
||||
let(:account) { Fabricate(:account) }
|
||||
let(:scheduled_status) { Fabricate.build(:scheduled_status, scheduled_at: 4.minutes.from_now, account: account) }
|
||||
let(:scheduled_status) { Fabricate.build(:scheduled_status, scheduled_at: 4.minutes.from_now, account: account, params: { application_id: 123 }) }
|
||||
|
||||
context 'with scheduled_at' do
|
||||
describe 'serialization' do
|
||||
it 'is serialized as RFC 3339 datetime' do
|
||||
expect { DateTime.rfc3339(subject['scheduled_at']) }.to_not raise_error
|
||||
expect { DateTime.rfc3339(subject['scheduled_at']) }
|
||||
.to_not raise_error
|
||||
end
|
||||
|
||||
it 'returns expected values and removes application_id from params' do
|
||||
expect(subject.deep_symbolize_keys)
|
||||
.to include(scheduled_at: be_a(String))
|
||||
.and include(params: not_include(:application_id))
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue