fix: Use to_i in campaign scheduled_at key (#3968)
This commit is contained in:
parent
2da618bd5e
commit
25001689ec
2 changed files with 2 additions and 1 deletions
|
@ -13,7 +13,7 @@ json.campaign_status resource.campaign_status
|
|||
json.enabled resource.enabled
|
||||
json.campaign_type resource.campaign_type
|
||||
if resource.campaign_type == 'one_off'
|
||||
json.scheduled_at resource.scheduled_at
|
||||
json.scheduled_at resource.scheduled_at.to_i
|
||||
json.audience resource.audience
|
||||
end
|
||||
json.trigger_rules resource.trigger_rules
|
||||
|
|
|
@ -145,6 +145,7 @@ RSpec.describe 'Campaigns API', type: :request do
|
|||
response_data = JSON.parse(response.body, symbolize_names: true)
|
||||
expect(response_data[:campaign_type]).to eq('one_off')
|
||||
expect(response_data[:scheduled_at].present?).to eq true
|
||||
expect(response_data[:scheduled_at]).to eq(2.days.from_now.to_i)
|
||||
expect(response_data[:audience].pluck(:id)).to include(label1.id, label2.id)
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue