Fixes #4127 - Webhhok transfers "accounted_time" of an article as integer instead of float/double.

This commit is contained in:
Rolf Schmidt 2022-06-15 15:48:00 +02:00
parent fbc1e4a252
commit cadb462208
2 changed files with 10 additions and 1 deletions

View file

@ -10,7 +10,7 @@ class TriggerWebhookJob::RecordPayload::Ticket::Article < TriggerWebhookJob::Rec
end
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
end

View file

@ -24,6 +24,15 @@ RSpec.describe TriggerWebhookJob::RecordPayload::Ticket::Article do
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
before do