From 3cc3d2a2132a4522c3e49ff7a961716d3e0f3811 Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Tue, 2 Apr 2013 09:12:20 +0200 Subject: [PATCH] Fixed timestamp compare. --- test/unit/ticket_test.rb | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/test/unit/ticket_test.rb b/test/unit/ticket_test.rb index 0c2d5713f..7f9d49f28 100644 --- a/test/unit/ticket_test.rb +++ b/test/unit/ticket_test.rb @@ -34,8 +34,8 @@ class TicketTest < ActiveSupport::TestCase ) ticket = Ticket.find(ticket.id) assert_equal( ticket.article_count, 1, 'ticket.article_count verify - inbound' ) - assert_equal( ticket.last_contact, article_inbound.created_at, 'ticket.last_contact verify - inbound' ) - assert_equal( ticket.last_contact_customer, article_inbound.created_at, 'ticket.last_contact_customer verify - inbound' ) + assert_equal( ticket.last_contact.to_s, article_inbound.created_at.to_s, 'ticket.last_contact verify - inbound' ) + assert_equal( ticket.last_contact_customer.to_s, article_inbound.created_at.to_s, 'ticket.last_contact_customer verify - inbound' ) assert_equal( ticket.last_contact_agent, nil, 'ticket.last_contact_agent verify - inbound' ) assert_equal( ticket.first_response, nil, 'ticket.first_response verify - inbound' ) assert_equal( ticket.close_time, nil, 'ticket.close_time verify - inbound' ) @@ -55,8 +55,8 @@ class TicketTest < ActiveSupport::TestCase ticket = Ticket.find(ticket.id) assert_equal( ticket.article_count, 2, 'ticket.article_count verify - note' ) - assert_equal( ticket.last_contact, article_inbound.created_at, 'ticket.last_contact verify - note' ) - assert_equal( ticket.last_contact_customer, article_inbound.created_at, 'ticket.last_contact_customer verify - note' ) + assert_equal( ticket.last_contact.to_s, article_inbound.created_at.to_s, 'ticket.last_contact verify - note' ) + assert_equal( ticket.last_contact_customer.to_s, article_inbound.created_at.to_s, 'ticket.last_contact_customer verify - note' ) assert_equal( ticket.last_contact_agent, nil, 'ticket.last_contact_agent verify - note' ) assert_equal( ticket.first_response, nil, 'ticket.first_response verify - note' ) assert_equal( ticket.close_time, nil, 'ticket.close_time verify - note' ) @@ -79,10 +79,10 @@ class TicketTest < ActiveSupport::TestCase ticket = Ticket.find(ticket.id) assert_equal( ticket.article_count, 3, 'ticket.article_count verify - outbound' ) - assert_equal( ticket.last_contact, article_outbound.created_at, 'ticket.last_contact verify - outbound' ) - assert_equal( ticket.last_contact_customer, article_inbound.created_at, 'ticket.last_contact_customer verify - outbound' ) - assert_equal( ticket.last_contact_agent, article_outbound.created_at, 'ticket.last_contact_agent verify - outbound' ) - assert_equal( ticket.first_response, article_outbound.created_at, 'ticket.first_response verify - outbound' ) + assert_equal( ticket.last_contact.to_s, article_outbound.created_at.to_s, 'ticket.last_contact verify - outbound' ) + assert_equal( ticket.last_contact_customer.to_s, article_inbound.created_at.to_s, 'ticket.last_contact_customer verify - outbound' ) + assert_equal( ticket.last_contact_agent.to_s, article_outbound.created_at.to_s, 'ticket.last_contact_agent verify - outbound' ) + assert_equal( ticket.first_response.to_s, article_outbound.created_at.to_s, 'ticket.first_response verify - outbound' ) assert_equal( ticket.close_time, nil, 'ticket.close_time verify - outbound' ) ticket.ticket_state_id = Ticket::State.where(:name => 'closed').first.id @@ -90,10 +90,10 @@ class TicketTest < ActiveSupport::TestCase ticket = Ticket.find(ticket.id) assert_equal( ticket.article_count, 3, 'ticket.article_count verify - state update' ) - assert_equal( ticket.last_contact, article_outbound.created_at, 'ticket.last_contact verify - state update' ) - assert_equal( ticket.last_contact_customer, article_inbound.created_at, 'ticket.last_contact_customer verify - state update' ) - assert_equal( ticket.last_contact_agent, article_outbound.created_at, 'ticket.last_contact_agent verify - state update' ) - assert_equal( ticket.first_response, article_outbound.created_at, 'ticket.first_response verify - state update' ) + assert_equal( ticket.last_contact.to_s, article_outbound.created_at.to_s, 'ticket.last_contact verify - state update' ) + assert_equal( ticket.last_contact_customer.to_s, article_inbound.created_at.to_s, 'ticket.last_contact_customer verify - state update' ) + assert_equal( ticket.last_contact_agent.to_s, article_outbound.created_at.to_s, 'ticket.last_contact_agent verify - state update' ) + assert_equal( ticket.first_response.to_s, article_outbound.created_at.to_s, 'ticket.first_response verify - state update' ) assert( ticket.close_time, 'ticket.close_time verify - state update' ) @@ -347,8 +347,8 @@ class TicketTest < ActiveSupport::TestCase ) ticket = Ticket.find(ticket.id) assert_equal( ticket.article_count, 1, 'ticket.article_count verify - inbound' ) - assert_equal( ticket.last_contact, article_inbound.created_at, 'ticket.last_contact verify - inbound' ) - assert_equal( ticket.last_contact_customer, article_inbound.created_at, 'ticket.last_contact_customer verify - inbound' ) + assert_equal( ticket.last_contact.to_s, article_inbound.created_at.to_s, 'ticket.last_contact verify - inbound' ) + assert_equal( ticket.last_contact_customer.to_s, article_inbound.created_at.to_s, 'ticket.last_contact_customer verify - inbound' ) assert_equal( ticket.last_contact_agent, nil, 'ticket.last_contact_agent verify - inbound' ) assert_equal( ticket.first_response, nil, 'ticket.first_response verify - inbound' ) assert_equal( ticket.close_time, nil, 'ticket.close_time verify - inbound' ) @@ -372,10 +372,10 @@ class TicketTest < ActiveSupport::TestCase ticket = Ticket.find(ticket.id) assert_equal( ticket.article_count, 2, 'ticket.article_count verify - outbound' ) - assert_equal( ticket.last_contact, article_outbound.created_at, 'ticket.last_contact verify - outbound' ) - assert_equal( ticket.last_contact_customer, article_inbound.created_at, 'ticket.last_contact_customer verify - outbound' ) - assert_equal( ticket.last_contact_agent, article_outbound.created_at, 'ticket.last_contact_agent verify - outbound' ) - assert_equal( ticket.first_response, article_outbound.created_at, 'ticket.first_response verify - outbound' ) + assert_equal( ticket.last_contact.to_s, article_outbound.created_at.to_s, 'ticket.last_contact verify - outbound' ) + assert_equal( ticket.last_contact_customer.to_s, article_inbound.created_at.to_s, 'ticket.last_contact_customer verify - outbound' ) + assert_equal( ticket.last_contact_agent.to_s, article_outbound.created_at.to_s, 'ticket.last_contact_agent verify - outbound' ) + assert_equal( ticket.first_response.to_s, article_outbound.created_at.to_s, 'ticket.first_response verify - outbound' ) assert_equal( ticket.first_response_in_min, 0, 'ticket.first_response_in_min verify - outbound' ) assert_equal( ticket.first_response_diff_in_min, 60, 'ticket.first_response_diff_in_min verify - outbound' ) assert_equal( ticket.close_time, nil, 'ticket.close_time verify - outbound' )