Fixed timestamp compare.

This commit is contained in:
Martin Edenhofer 2013-04-02 09:12:20 +02:00
parent 4f3cfb8e74
commit 3cc3d2a213

View file

@ -34,8 +34,8 @@ class TicketTest < ActiveSupport::TestCase
) )
ticket = Ticket.find(ticket.id) ticket = Ticket.find(ticket.id)
assert_equal( ticket.article_count, 1, 'ticket.article_count verify - inbound' ) 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.to_s, article_inbound.created_at.to_s, '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_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.last_contact_agent, nil, 'ticket.last_contact_agent verify - inbound' )
assert_equal( ticket.first_response, nil, 'ticket.first_response verify - inbound' ) assert_equal( ticket.first_response, nil, 'ticket.first_response verify - inbound' )
assert_equal( ticket.close_time, nil, 'ticket.close_time 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) ticket = Ticket.find(ticket.id)
assert_equal( ticket.article_count, 2, 'ticket.article_count verify - note' ) 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.to_s, article_inbound.created_at.to_s, '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_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.last_contact_agent, nil, 'ticket.last_contact_agent verify - note' )
assert_equal( ticket.first_response, nil, 'ticket.first_response verify - note' ) assert_equal( ticket.first_response, nil, 'ticket.first_response verify - note' )
assert_equal( ticket.close_time, nil, 'ticket.close_time 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) ticket = Ticket.find(ticket.id)
assert_equal( ticket.article_count, 3, 'ticket.article_count verify - outbound' ) 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.to_s, article_outbound.created_at.to_s, '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_customer.to_s, article_inbound.created_at.to_s, '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.last_contact_agent.to_s, article_outbound.created_at.to_s, 'ticket.last_contact_agent verify - outbound' )
assert_equal( ticket.first_response, article_outbound.created_at, 'ticket.first_response 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' ) assert_equal( ticket.close_time, nil, 'ticket.close_time verify - outbound' )
ticket.ticket_state_id = Ticket::State.where(:name => 'closed').first.id ticket.ticket_state_id = Ticket::State.where(:name => 'closed').first.id
@ -90,10 +90,10 @@ class TicketTest < ActiveSupport::TestCase
ticket = Ticket.find(ticket.id) ticket = Ticket.find(ticket.id)
assert_equal( ticket.article_count, 3, 'ticket.article_count verify - state update' ) 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.to_s, article_outbound.created_at.to_s, '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_customer.to_s, article_inbound.created_at.to_s, '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.last_contact_agent.to_s, article_outbound.created_at.to_s, '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.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' ) assert( ticket.close_time, 'ticket.close_time verify - state update' )
@ -347,8 +347,8 @@ class TicketTest < ActiveSupport::TestCase
) )
ticket = Ticket.find(ticket.id) ticket = Ticket.find(ticket.id)
assert_equal( ticket.article_count, 1, 'ticket.article_count verify - inbound' ) 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.to_s, article_inbound.created_at.to_s, '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_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.last_contact_agent, nil, 'ticket.last_contact_agent verify - inbound' )
assert_equal( ticket.first_response, nil, 'ticket.first_response verify - inbound' ) assert_equal( ticket.first_response, nil, 'ticket.first_response verify - inbound' )
assert_equal( ticket.close_time, nil, 'ticket.close_time 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) ticket = Ticket.find(ticket.id)
assert_equal( ticket.article_count, 2, 'ticket.article_count verify - outbound' ) 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.to_s, article_outbound.created_at.to_s, '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_customer.to_s, article_inbound.created_at.to_s, '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.last_contact_agent.to_s, article_outbound.created_at.to_s, 'ticket.last_contact_agent verify - outbound' )
assert_equal( ticket.first_response, article_outbound.created_at, 'ticket.first_response 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_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.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' ) assert_equal( ticket.close_time, nil, 'ticket.close_time verify - outbound' )