Follow up for issue #2082 - improved tests - escalation_at are not updated correctly.

This commit is contained in:
Martin Edenhofer 2018-06-15 15:08:10 +02:00
parent 28a1bbe4c6
commit db82816f87

View file

@ -192,10 +192,10 @@ Some Text"
ticket_p, article_p, user_p, mail = Channel::EmailParser.new.process({}, email) ticket_p, article_p, user_p, mail = Channel::EmailParser.new.process({}, email)
ticket_p.reload ticket_p.reload
assert(ticket_p.escalation_at) assert(ticket_p.escalation_at)
assert_equal(ticket_p.first_response_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_equal(ticket_p.update_escalation_at.to_s, (ticket_p.created_at + 3.hours).to_s) assert_in_delta(ticket_p.update_escalation_at.to_i, (ticket_p.created_at + 3.hours).to_i, 120)
assert_equal(ticket_p.close_escalation_at.to_s, (ticket_p.created_at + 4.hours).to_s) assert_in_delta(ticket_p.close_escalation_at.to_i, (ticket_p.created_at + 4.hours).to_i, 120)
assert_equal(ticket_p.escalation_at.to_s, (ticket_p.created_at + 1.hour).to_s) assert_in_delta(ticket_p.escalation_at.to_i, (ticket_p.created_at + 1.hour).to_i, 120)
travel 3.hours travel 3.hours
article = nil article = nil
@ -217,10 +217,10 @@ Some Text"
end end
ticket_p.reload ticket_p.reload
assert_equal(ticket_p.first_response_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_equal(ticket_p.update_escalation_at.to_s, (ticket_p.last_contact_agent_at + 3.hours).to_s) assert_in_delta(ticket_p.update_escalation_at.to_i, (ticket_p.last_contact_agent_at + 3.hours).to_i, 120)
assert_equal(ticket_p.close_escalation_at.to_s, (ticket_p.created_at + 4.hours).to_s) assert_in_delta(ticket_p.close_escalation_at.to_i, (ticket_p.created_at + 4.hours).to_i, 120)
assert_equal(ticket_p.escalation_at.to_s, (ticket_p.created_at + 4.hours).to_s) assert_in_delta(ticket_p.escalation_at.to_i, (ticket_p.created_at + 4.hours).to_i, 120)
end end
end end