From db82816f87ac773b919512c096e88e8dc2adc1e8 Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Fri, 15 Jun 2018 15:08:10 +0200 Subject: [PATCH] Follow up for issue #2082 - improved tests - escalation_at are not updated correctly. --- test/unit/ticket_escalation_test.rb | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/test/unit/ticket_escalation_test.rb b/test/unit/ticket_escalation_test.rb index 1465f08db..89045bb3c 100644 --- a/test/unit/ticket_escalation_test.rb +++ b/test/unit/ticket_escalation_test.rb @@ -192,10 +192,10 @@ Some Text" ticket_p, article_p, user_p, mail = Channel::EmailParser.new.process({}, email) ticket_p.reload assert(ticket_p.escalation_at) - assert_equal(ticket_p.first_response_escalation_at.to_s, (ticket_p.created_at + 1.hour).to_s) - assert_equal(ticket_p.update_escalation_at.to_s, (ticket_p.created_at + 3.hours).to_s) - assert_equal(ticket_p.close_escalation_at.to_s, (ticket_p.created_at + 4.hours).to_s) - assert_equal(ticket_p.escalation_at.to_s, (ticket_p.created_at + 1.hour).to_s) + assert_in_delta(ticket_p.first_response_escalation_at.to_i, (ticket_p.created_at + 1.hour).to_i, 120) + assert_in_delta(ticket_p.update_escalation_at.to_i, (ticket_p.created_at + 3.hours).to_i, 120) + assert_in_delta(ticket_p.close_escalation_at.to_i, (ticket_p.created_at + 4.hours).to_i, 120) + assert_in_delta(ticket_p.escalation_at.to_i, (ticket_p.created_at + 1.hour).to_i, 120) travel 3.hours article = nil @@ -217,10 +217,10 @@ Some Text" end ticket_p.reload - assert_equal(ticket_p.first_response_escalation_at.to_s, (ticket_p.created_at + 1.hour).to_s) - assert_equal(ticket_p.update_escalation_at.to_s, (ticket_p.last_contact_agent_at + 3.hours).to_s) - assert_equal(ticket_p.close_escalation_at.to_s, (ticket_p.created_at + 4.hours).to_s) - assert_equal(ticket_p.escalation_at.to_s, (ticket_p.created_at + 4.hours).to_s) + assert_in_delta(ticket_p.first_response_escalation_at.to_i, (ticket_p.created_at + 1.hour).to_i, 120) + assert_in_delta(ticket_p.update_escalation_at.to_i, (ticket_p.last_contact_agent_at + 3.hours).to_i, 120) + assert_in_delta(ticket_p.close_escalation_at.to_i, (ticket_p.created_at + 4.hours).to_i, 120) + assert_in_delta(ticket_p.escalation_at.to_i, (ticket_p.created_at + 4.hours).to_i, 120) end end