Fixes #4127 - Webhhok transfers "accounted_time" of an article as integer instead of float/double.
This commit is contained in:
parent
fbc1e4a252
commit
cadb462208
2 changed files with 10 additions and 1 deletions
|
@ -10,7 +10,7 @@ class TriggerWebhookJob::RecordPayload::Ticket::Article < TriggerWebhookJob::Rec
|
||||||
end
|
end
|
||||||
|
|
||||||
def add_accounted_time(result)
|
def add_accounted_time(result)
|
||||||
result['accounted_time'] = record.ticket_time_accounting&.time_unit.to_i
|
result['accounted_time'] = record.ticket_time_accounting&.time_unit.to_f
|
||||||
result
|
result
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -24,6 +24,15 @@ RSpec.describe TriggerWebhookJob::RecordPayload::Ticket::Article do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
describe 'Webhhok transfers "accounted_time" of an article as integer instead of float/double #4127' do
|
||||||
|
let(:entry) { create(:ticket_time_accounting, ticket_id: record.ticket.id, ticket_article_id: record.id, time_unit: 3.33) }
|
||||||
|
|
||||||
|
it "stores value as 'accounted_time' key" do
|
||||||
|
entry
|
||||||
|
expect(generate['accounted_time']).to eq(3.33)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
context 'when Article has stored attachments' do
|
context 'when Article has stored attachments' do
|
||||||
|
|
||||||
before do
|
before do
|
||||||
|
|
Loading…
Reference in a new issue