Moved to new mini test 6 changes.

This commit is contained in:
Martin Edenhofer 2017-03-24 11:02:13 +01:00
parent c6e96f6410
commit 56216a0dd4
16 changed files with 156 additions and 156 deletions

View file

@ -242,7 +242,7 @@ class ChatTest < ActiveSupport::TestCase
assert_equal('message 3', customer_state[:session][2]['content'])
assert_equal('message 4', customer_state[:session][3]['content'])
assert_equal('Notification Agent1', customer_state[:agent][:name])
assert_equal(nil, customer_state[:agent][:avatar])
assert_nil(customer_state[:agent][:avatar])
# check agent1 state
agent_state = Chat.agent_state_with_sessions(agent1.id)

View file

@ -194,7 +194,7 @@ Mob: +49 333 1112222",
assert_equal(1, caller_ids.length)
assert_equal('maybe', caller_ids[0].level)
assert_equal(2, caller_ids[0].user_id)
assert_equal(nil, caller_ids[0].comment)
assert_nil(caller_ids[0].comment)
Cti::CallerId.maybe_add(
caller_id: '4912345678901',
@ -208,7 +208,7 @@ Mob: +49 333 1112222",
assert_equal(1, caller_ids.length)
assert_equal('maybe', caller_ids[0].level)
assert_equal(2, caller_ids[0].user_id)
assert_equal(nil, caller_ids[0].comment)
assert_nil(caller_ids[0].comment)
Cti::CallerId.maybe_add(
caller_id: '4912345678901',
@ -222,10 +222,10 @@ Mob: +49 333 1112222",
assert_equal(2, caller_ids.length)
assert_equal('maybe', caller_ids[0].level)
assert_equal(3, caller_ids[0].user_id)
assert_equal(nil, caller_ids[0].comment)
assert_nil(caller_ids[0].comment)
assert_equal('maybe', caller_ids[1].level)
assert_equal(2, caller_ids[1].user_id)
assert_equal(nil, caller_ids[1].comment)
assert_nil(caller_ids[1].comment)
Cti::CallerId.maybe_add(
caller_id: '4912345678901',
@ -239,7 +239,7 @@ Mob: +49 333 1112222",
assert_equal(1, caller_ids.length)
assert_equal('known', caller_ids[0].level)
assert_equal(3, caller_ids[0].user_id)
assert_equal(nil, caller_ids[0].comment)
assert_nil(caller_ids[0].comment)
end
end

View file

@ -70,13 +70,13 @@ class EmailBuildTest < ActiveSupport::TestCase
if data[:attachments]
data[:attachments].each { |attachment|
if attachment[:filename] == 'message.html'
assert_equal(nil, attachment[:preferences]['Content-ID'])
assert_nil(attachment[:preferences]['Content-ID'])
assert_equal(true, attachment[:preferences]['content-alternative'])
assert_equal('text/html', attachment[:preferences]['Mime-Type'])
assert_equal('UTF-8', attachment[:preferences]['Charset'])
elsif attachment[:filename] == 'somename.png'
assert_equal(nil, attachment[:preferences]['Content-ID'])
assert_equal(nil, attachment[:preferences]['content-alternative'])
assert_nil(attachment[:preferences]['Content-ID'])
assert_nil(attachment[:preferences]['content-alternative'])
assert_equal('image/png', attachment[:preferences]['Mime-Type'])
assert_equal('UTF-8', attachment[:preferences]['Charset'])
else
@ -109,7 +109,7 @@ class EmailBuildTest < ActiveSupport::TestCase
> Thank you for installing Zammad. äöüß
>'
assert_equal(should, mail.text_part.body.to_s)
assert_equal(nil, mail.html_part)
assert_nil(mail.html_part)
parser = Channel::EmailParser.new
data = parser.parse(mail.to_s)
@ -124,8 +124,8 @@ class EmailBuildTest < ActiveSupport::TestCase
if data[:attachments]
data[:attachments].each { |attachment|
if attachment[:filename] == 'somename.png'
assert_equal(nil, attachment[:preferences]['Content-ID'])
assert_equal(nil, attachment[:preferences]['content-alternative'])
assert_nil(attachment[:preferences]['Content-ID'])
assert_nil(attachment[:preferences]['content-alternative'])
assert_equal('image/png', attachment[:preferences]['Mime-Type'])
assert_equal('UTF-8', attachment[:preferences]['Charset'])
else
@ -151,7 +151,7 @@ class EmailBuildTest < ActiveSupport::TestCase
> Thank you for installing Zammad. äöüß
>'
assert_equal(should, mail.body.to_s)
assert_equal(nil, mail.html_part)
assert_nil(mail.html_part)
parser = Channel::EmailParser.new
data = parser.parse(mail.to_s)

View file

@ -222,7 +222,7 @@ Comment: [] =
assert_equal('icinga', ticket_3.preferences['integration'])
assert(ticket_3.preferences['icinga'])
assert_equal('apn4711.dc.example.com', ticket_3.preferences['icinga']['host'])
assert_equal(nil, ticket_3.preferences['icinga']['service'])
assert_nil(ticket_3.preferences['icinga']['service'])
assert_equal('DOWN', ticket_3.preferences['icinga']['state'])
assert_not_equal(ticket_3.id, ticket_1.id)
@ -258,7 +258,7 @@ Comment: [] =
assert_equal('icinga', ticket_3_1.preferences['integration'])
assert(ticket_3_1.preferences['icinga'])
assert_equal('apn4711.dc.example.com', ticket_3.preferences['icinga']['host'])
assert_equal(nil, ticket_3_1.preferences['icinga']['service'])
assert_nil(ticket_3_1.preferences['icinga']['service'])
assert_equal('DOWN', ticket_3_1.preferences['icinga']['state'])
#Setting.set('icinga_integration', false)

View file

@ -208,7 +208,7 @@ Comment: [] =
assert_equal('nagios', ticket_3.preferences['integration'])
assert(ticket_3.preferences['nagios'])
assert_equal('apn4711.dc.example.com', ticket_3.preferences['nagios']['host'])
assert_equal(nil, ticket_3.preferences['nagios']['service'])
assert_nil(ticket_3.preferences['nagios']['service'])
assert_equal('DOWN', ticket_3.preferences['nagios']['state'])
assert_not_equal(ticket_3.id, ticket_1.id)
@ -244,7 +244,7 @@ Comment: [] =
assert_equal('nagios', ticket_3_1.preferences['integration'])
assert(ticket_3_1.preferences['nagios'])
assert_equal('apn4711.dc.example.com', ticket_3.preferences['nagios']['host'])
assert_equal(nil, ticket_3_1.preferences['nagios']['service'])
assert_nil(ticket_3_1.preferences['nagios']['service'])
assert_equal('DOWN', ticket_3_1.preferences['nagios']['state'])
#Setting.set('nagios_integration', false)

View file

@ -187,14 +187,14 @@ class NotificationFactoryMailerTest < ActiveSupport::TestCase
assert_equal(true, result[:channels][:email])
result = NotificationFactory::Mailer.notification_settings(agent2, ticket2, 'create')
assert_equal(nil, result)
assert_nil(result)
result = NotificationFactory::Mailer.notification_settings(agent2, ticket3, 'create')
assert_equal(true, result[:channels][:online])
assert_equal(true, result[:channels][:email])
result = NotificationFactory::Mailer.notification_settings(agent2, ticket4, 'create')
assert_equal(nil, result)
assert_nil(result)
# no group selection
agent1.preferences[:notification_config][:group_ids] = []
@ -224,14 +224,14 @@ class NotificationFactoryMailerTest < ActiveSupport::TestCase
assert_equal(true, result[:channels][:email])
result = NotificationFactory::Mailer.notification_settings(agent2, ticket2, 'create')
assert_equal(nil, result)
assert_nil(result)
result = NotificationFactory::Mailer.notification_settings(agent2, ticket3, 'create')
assert_equal(true, result[:channels][:online])
assert_equal(true, result[:channels][:email])
result = NotificationFactory::Mailer.notification_settings(agent2, ticket4, 'create')
assert_equal(nil, result)
assert_nil(result)
agent1.preferences[:notification_config][:group_ids] = ['-']
agent1.save
@ -260,14 +260,14 @@ class NotificationFactoryMailerTest < ActiveSupport::TestCase
assert_equal(true, result[:channels][:email])
result = NotificationFactory::Mailer.notification_settings(agent2, ticket2, 'create')
assert_equal(nil, result)
assert_nil(result)
result = NotificationFactory::Mailer.notification_settings(agent2, ticket3, 'create')
assert_equal(true, result[:channels][:online])
assert_equal(true, result[:channels][:email])
result = NotificationFactory::Mailer.notification_settings(agent2, ticket4, 'create')
assert_equal(nil, result)
assert_nil(result)
# dedecated group selection
agent1.preferences[:notification_config][:group_ids] = [Group.lookup(name: 'Users').id]
@ -282,7 +282,7 @@ class NotificationFactoryMailerTest < ActiveSupport::TestCase
assert_equal(true, result[:channels][:email])
result = NotificationFactory::Mailer.notification_settings(agent1, ticket3, 'create')
assert_equal(nil, result)
assert_nil(result)
result = NotificationFactory::Mailer.notification_settings(agent1, ticket4, 'create')
assert_equal(true, result[:channels][:online])
@ -296,14 +296,14 @@ class NotificationFactoryMailerTest < ActiveSupport::TestCase
assert_equal(true, result[:channels][:email])
result = NotificationFactory::Mailer.notification_settings(agent2, ticket2, 'create')
assert_equal(nil, result)
assert_nil(result)
result = NotificationFactory::Mailer.notification_settings(agent2, ticket3, 'create')
assert_equal(nil, result)
assert_equal(nil, result)
assert_nil(result)
assert_nil(result)
result = NotificationFactory::Mailer.notification_settings(agent2, ticket4, 'create')
assert_equal(nil, result)
assert_nil(result)
end

View file

@ -118,7 +118,7 @@ class ObjectCreateUpdateWithRefNameTest < ActiveSupport::TestCase
assert(user1.role_ids.include?(agent_role.id))
assert_not(user1.role_ids.include?(customer_role.id))
assert_equal(nil, user2.organization_id)
assert_nil(user2.organization_id)
assert_not(user2.group_ids.include?(users_group.id))
assert_not(user2.role_ids.include?(admin_role.id))
assert_not(user2.role_ids.include?(agent_role.id))

View file

@ -655,10 +655,10 @@ class ObjectManagerTest < ActiveSupport::TestCase
assert_equal('some attribute test2', ticket2.title)
assert_equal('Users', ticket2.group.name)
assert_equal('new', ticket2.state.name)
assert_equal(nil, ticket2[:attribute1])
assert_equal(nil, ticket2[:attribute2])
assert_equal(nil, ticket2[:attribute3])
assert_equal(nil, ticket2[:attribute4])
assert_nil(ticket2[:attribute1])
assert_nil(ticket2[:attribute2])
assert_nil(ticket2[:attribute3])
assert_nil(ticket2[:attribute4])
end

View file

@ -58,7 +58,7 @@ class OrganizationDomainBasedAssignmentTest < ActiveSupport::TestCase
updated_by_id: 1,
created_by_id: 1,
)
assert_equal(nil, customer3.organization_id)
assert_nil(customer3.organization_id)
customer4 = User.create_or_update(
login: 'organization-based_assignment-customer4',
@ -71,7 +71,7 @@ class OrganizationDomainBasedAssignmentTest < ActiveSupport::TestCase
updated_by_id: 1,
created_by_id: 1,
)
assert_equal(nil, customer4.organization_id)
assert_nil(customer4.organization_id)
end

View file

@ -41,7 +41,7 @@ class SessionBasicTest < ActiveSupport::TestCase
assert_equal(true, result, 'check 2')
result = Sessions::CacheIn.get('last_run_test')
assert_equal(nil, result, 'check 2')
assert_nil(result, 'check 2')
# check delete cache
Sessions::CacheIn.set('last_run_delete', true, { expires_in: 5.seconds })
@ -49,7 +49,7 @@ class SessionBasicTest < ActiveSupport::TestCase
assert_equal(true, result, 'check 1')
Sessions::CacheIn.delete('last_run_delete')
result = Sessions::CacheIn.get('last_run_delete')
assert_equal(nil, nil, 'check delete')
assert_nil(result, 'check delete')
travel_back
end
@ -84,7 +84,7 @@ class SessionBasicTest < ActiveSupport::TestCase
data = Sessions.get(client_id1)
assert(data[:meta], 'check if meta exists')
assert(data[:user], 'check if user exists')
assert_equal(data[:user]['id'], nil, 'check if user id is correct')
assert_nil(data[:user]['id'], 'check if user id is correct')
# recreate session
Sessions.create(client_id1, agent1.attributes, { type: 'websocket' })

View file

@ -67,7 +67,7 @@ class TicketCustomerOrganizationUpdateTest < ActiveSupport::TestCase
# verify ticket
ticket = Ticket.find(ticket.id)
assert_equal(nil, ticket.organization_id)
assert_nil(ticket.organization_id)
# update customer organization
customer1.organization_id = organization1.id

View file

@ -127,7 +127,7 @@ class TicketRefObjectTouchTest < ActiveSupport::TestCase
)
assert(ticket, 'ticket created')
assert_equal(ticket.customer.id, customer2.id)
assert_equal(ticket.organization, nil)
assert_nil(ticket.organization)
# check if customer and organization has been touched
customer2 = User.find(customer2.id)

View file

@ -115,7 +115,7 @@ class TicketSelectorTest < ActiveSupport::TestCase
)
assert(ticket2, 'ticket created')
assert_equal(ticket2.customer.id, customer2.id)
assert_equal(ticket2.organization_id, nil)
assert_nil(ticket2.organization_id)
travel 1.second
ticket3 = Ticket.create!(
@ -132,7 +132,7 @@ class TicketSelectorTest < ActiveSupport::TestCase
ticket3.update_columns(escalation_at: '2015-02-06 10:00:00')
assert(ticket3, 'ticket created')
assert_equal(ticket3.customer.id, customer2.id)
assert_equal(ticket3.organization_id, nil)
assert_nil(ticket3.organization_id)
travel 1.second
# search not matching
@ -166,19 +166,19 @@ class TicketSelectorTest < ActiveSupport::TestCase
}
ticket_count, tickets = Ticket.selectors(condition, 10)
assert_equal(ticket_count, nil)
assert_nil(ticket_count)
ticket_count, tickets = Ticket.selectors(condition, 10, agent1)
assert_equal(ticket_count, nil)
assert_nil(ticket_count)
ticket_count, tickets = Ticket.selectors(condition, 10, agent2)
assert_equal(ticket_count, nil)
assert_nil(ticket_count)
ticket_count, tickets = Ticket.selectors(condition, 10, customer1)
assert_equal(ticket_count, nil)
assert_nil(ticket_count)
ticket_count, tickets = Ticket.selectors(condition, 10, customer2)
assert_equal(ticket_count, nil)
assert_nil(ticket_count)
# search matching with empty value []
condition = {
@ -193,19 +193,19 @@ class TicketSelectorTest < ActiveSupport::TestCase
}
ticket_count, tickets = Ticket.selectors(condition, 10)
assert_equal(ticket_count, nil)
assert_nil(ticket_count)
ticket_count, tickets = Ticket.selectors(condition, 10, agent1)
assert_equal(ticket_count, nil)
assert_nil(ticket_count)
ticket_count, tickets = Ticket.selectors(condition, 10, agent2)
assert_equal(ticket_count, nil)
assert_nil(ticket_count)
ticket_count, tickets = Ticket.selectors(condition, 10, customer1)
assert_equal(ticket_count, nil)
assert_nil(ticket_count)
ticket_count, tickets = Ticket.selectors(condition, 10, customer2)
assert_equal(ticket_count, nil)
assert_nil(ticket_count)
# search matching with empty value ''
condition = {
@ -220,19 +220,19 @@ class TicketSelectorTest < ActiveSupport::TestCase
}
ticket_count, tickets = Ticket.selectors(condition, 10)
assert_equal(ticket_count, nil)
assert_nil(ticket_count)
ticket_count, tickets = Ticket.selectors(condition, 10, agent1)
assert_equal(ticket_count, nil)
assert_nil(ticket_count)
ticket_count, tickets = Ticket.selectors(condition, 10, agent2)
assert_equal(ticket_count, nil)
assert_nil(ticket_count)
ticket_count, tickets = Ticket.selectors(condition, 10, customer1)
assert_equal(ticket_count, nil)
assert_nil(ticket_count)
ticket_count, tickets = Ticket.selectors(condition, 10, customer2)
assert_equal(ticket_count, nil)
assert_nil(ticket_count)
# search matching
condition = {
@ -785,16 +785,16 @@ class TicketSelectorTest < ActiveSupport::TestCase
},
}
ticket_count, tickets = Ticket.selectors(condition, 10, agent1)
assert_equal(ticket_count, nil)
assert_nil(ticket_count)
ticket_count, tickets = Ticket.selectors(condition, 10, agent2)
assert_equal(ticket_count, nil)
assert_nil(ticket_count)
ticket_count, tickets = Ticket.selectors(condition, 10, customer1)
assert_equal(ticket_count, nil)
assert_nil(ticket_count)
ticket_count, tickets = Ticket.selectors(condition, 10, customer2)
assert_equal(ticket_count, nil)
assert_nil(ticket_count)
condition = {
'ticket.group_id' => {

View file

@ -23,7 +23,7 @@ class TicketSlaTest < ActiveSupport::TestCase
created_by_id: 1,
)
assert(ticket, 'ticket created')
assert_equal(ticket.escalation_at, nil, 'ticket.escalation_at verify')
assert_nil(ticket.escalation_at, 'ticket.escalation_at verify')
calendar1 = Calendar.create_or_update(
name: 'EU 1',
@ -157,17 +157,17 @@ class TicketSlaTest < ActiveSupport::TestCase
ticket = Ticket.find(ticket.id)
assert_equal(ticket.escalation_at.gmtime.to_s, '2013-03-21 10:30:00 UTC', 'ticket.escalation_at verify 2')
assert_equal(ticket.first_response_escalation_at.gmtime.to_s, '2013-03-21 10:30:00 UTC', 'ticket.first_response_escalation_at verify 2')
assert_equal(ticket.first_response_at, nil, 'ticket.first_response_at verify 2')
assert_equal(ticket.first_response_in_min, nil, 'ticket.first_response_in_min verify 2')
assert_equal(ticket.first_response_diff_in_min, nil, 'ticket.first_response_diff_in_min verify 2')
assert_nil(ticket.first_response_at, 'ticket.first_response_at verify 2')
assert_nil(ticket.first_response_in_min, 'ticket.first_response_in_min verify 2')
assert_nil(ticket.first_response_diff_in_min, 'ticket.first_response_diff_in_min verify 2')
assert_equal(ticket.update_escalation_at.gmtime.to_s, '2013-03-21 11:30:00 UTC', 'ticket.update_escalation_at verify 2')
assert_equal(ticket.update_in_min, nil, 'ticket.update_in_min verify 2')
assert_equal(ticket.update_diff_in_min, nil, 'ticket.update_diff_in_min verify 2')
assert_nil(ticket.update_in_min, 'ticket.update_in_min verify 2')
assert_nil(ticket.update_diff_in_min, 'ticket.update_diff_in_min verify 2')
assert_equal(ticket.close_escalation_at.gmtime.to_s, '2013-03-21 12:30:00 UTC', 'ticket.close_escalation_at verify 2')
assert_equal(ticket.close_in_min, nil, 'ticket.close_in_min verify 2')
assert_equal(ticket.close_diff_in_min, nil, 'ticket.close_diff_in_min verify 2')
assert_nil(ticket.close_in_min, 'ticket.close_in_min verify 2')
assert_nil(ticket.close_diff_in_min, 'ticket.close_diff_in_min verify 2')
# set first response in time
ticket.update_attributes(
@ -181,12 +181,12 @@ class TicketSlaTest < ActiveSupport::TestCase
assert_equal(ticket.first_response_diff_in_min, 30, 'ticket.first_response_diff_in_min verify 3')
assert_equal(ticket.update_escalation_at.gmtime.to_s, '2013-03-21 11:30:00 UTC', 'ticket.update_escalation_at verify 3')
assert_equal(ticket.update_in_min, nil, 'ticket.update_in_min verify 3')
assert_equal(ticket.update_diff_in_min, nil, 'ticket.update_diff_in_min verify 3')
assert_nil(ticket.update_in_min, 'ticket.update_in_min verify 3')
assert_nil(ticket.update_diff_in_min, 'ticket.update_diff_in_min verify 3')
assert_equal(ticket.close_escalation_at.gmtime.to_s, '2013-03-21 12:30:00 UTC', 'ticket.close_escalation_at verify 3')
assert_equal(ticket.close_in_min, nil, 'ticket.close_in_min verify 3')
assert_equal(ticket.close_diff_in_min, nil, 'ticket.close_diff_in_min verify 3')
assert_nil(ticket.close_in_min, 'ticket.close_in_min verify 3')
assert_nil(ticket.close_diff_in_min, 'ticket.close_diff_in_min verify 3')
# set first reponse over time
ticket.update_attributes(
@ -200,12 +200,12 @@ class TicketSlaTest < ActiveSupport::TestCase
assert_equal(ticket.first_response_diff_in_min, -210, 'ticket.first_response_diff_in_min verify 4')
assert_equal(ticket.update_escalation_at.gmtime.to_s, '2013-03-21 11:30:00 UTC', 'ticket.update_escalation_at verify 4')
assert_equal(ticket.update_in_min, nil, 'ticket.update_in_min verify 4')
assert_equal(ticket.update_diff_in_min, nil, 'ticket.update_diff_in_min verify 4')
assert_nil(ticket.update_in_min, 'ticket.update_in_min verify 4')
assert_nil(ticket.update_diff_in_min, 'ticket.update_diff_in_min verify 4')
assert_equal(ticket.close_escalation_at.gmtime.to_s, '2013-03-21 12:30:00 UTC', 'ticket.close_escalation_at verify 4')
assert_equal(ticket.close_in_min, nil, 'ticket.close_in_min verify 4')
assert_equal(ticket.close_diff_in_min, nil, 'ticket.close_diff_in_min verify 4')
assert_nil(ticket.close_in_min, 'ticket.close_in_min verify 4')
assert_nil(ticket.close_diff_in_min, 'ticket.close_diff_in_min verify 4')
# set update time in time
ticket.update_attributes(
@ -223,8 +223,8 @@ class TicketSlaTest < ActiveSupport::TestCase
assert_equal(ticket.update_diff_in_min, 30, 'ticket.update_diff_in_min verify 5')
assert_equal(ticket.close_escalation_at.gmtime.to_s, '2013-03-21 12:30:00 UTC', 'ticket.close_escalation_at verify 5')
assert_equal(ticket.close_in_min, nil, 'ticket.close_in_min verify 5')
assert_equal(ticket.close_diff_in_min, nil, 'ticket.close_diff_in_min verify 5')
assert_nil(ticket.close_in_min, 'ticket.close_in_min verify 5')
assert_nil(ticket.close_diff_in_min, 'ticket.close_diff_in_min verify 5')
# set update time over time
ticket.update_attributes(
@ -242,8 +242,8 @@ class TicketSlaTest < ActiveSupport::TestCase
assert_equal(ticket.update_diff_in_min, -30, 'ticket.update_diff_in_min verify 6')
assert_equal(ticket.close_escalation_at.gmtime.to_s, '2013-03-21 12:30:00 UTC', 'ticket.close_escalation_at verify 6')
assert_equal(ticket.close_in_min, nil, 'ticket.close_in_min verify 6')
assert_equal(ticket.close_diff_in_min, nil, 'ticket.close_diff_in_min verify 6')
assert_nil(ticket.close_in_min, 'ticket.close_in_min verify 6')
assert_nil(ticket.close_diff_in_min, 'ticket.close_diff_in_min verify 6')
# set update time over time
ticket.update_attributes(
@ -261,8 +261,8 @@ class TicketSlaTest < ActiveSupport::TestCase
assert_equal(ticket.update_diff_in_min, -35, 'ticket.update_diff_in_min verify 6')
assert_equal(ticket.close_escalation_at.gmtime.to_s, '2013-03-21 12:30:00 UTC', 'ticket.close_escalation_at verify 6')
assert_equal(ticket.close_in_min, nil, 'ticket.close_in_min verify 6')
assert_equal(ticket.close_diff_in_min, nil, 'ticket.close_diff_in_min verify 6')
assert_nil(ticket.close_in_min, 'ticket.close_in_min verify 6')
assert_nil(ticket.close_diff_in_min, 'ticket.close_diff_in_min verify 6')
# set update time over time
ticket.update_attributes(
@ -280,8 +280,8 @@ class TicketSlaTest < ActiveSupport::TestCase
assert_equal(ticket.update_diff_in_min, -40, 'ticket.update_diff_in_min verify 6')
assert_equal(ticket.close_escalation_at.gmtime.to_s, '2013-03-21 12:30:00 UTC', 'ticket.close_escalation_at verify 6')
assert_equal(ticket.close_in_min, nil, 'ticket.close_in_min verify 6')
assert_equal(ticket.close_diff_in_min, nil, 'ticket.close_diff_in_min verify 6')
assert_nil(ticket.close_in_min, 'ticket.close_in_min verify 6')
assert_nil(ticket.close_diff_in_min, 'ticket.close_diff_in_min verify 6')
# set close time in time
ticket.update_attributes(
@ -325,7 +325,7 @@ class TicketSlaTest < ActiveSupport::TestCase
ticket.update_attributes(
state: Ticket::State.lookup(name: 'closed')
)
assert_equal(ticket.escalation_at, nil, 'ticket.escalation_at verify 9')
assert_nil(ticket.escalation_at, 'ticket.escalation_at verify 9')
assert_equal(ticket.first_response_escalation_at.gmtime.to_s, '2013-03-21 10:30:00 UTC', 'ticket.first_response_escalation_at verify 9')
assert_equal(ticket.first_response_at.gmtime.to_s, '2013-03-21 14:00:00 UTC', 'ticket.first_response_at verify 9')
@ -380,9 +380,9 @@ class TicketSlaTest < ActiveSupport::TestCase
assert_equal(ticket.article_count, 1, 'ticket.article_count verify - inbound')
assert_equal(ticket.last_contact_at.to_s, article_inbound.created_at.to_s, 'ticket.last_contact_at verify - inbound')
assert_equal(ticket.last_contact_customer_at.to_s, article_inbound.created_at.to_s, 'ticket.last_contact_customer_at verify - inbound')
assert_equal(ticket.last_contact_agent_at, nil, 'ticket.last_contact_agent_at verify - inbound')
assert_equal(ticket.first_response_at, nil, 'ticket.first_response_at verify - inbound')
assert_equal(ticket.close_at, nil, 'ticket.close_at verify - inbound')
assert_nil(ticket.last_contact_agent_at, 'ticket.last_contact_agent_at verify - inbound')
assert_nil(ticket.first_response_at, 'ticket.first_response_at verify - inbound')
assert_nil(ticket.close_at, 'ticket.close_at verify - inbound')
# create outbound article
article_outbound = Ticket::Article.create!(
@ -409,7 +409,7 @@ class TicketSlaTest < ActiveSupport::TestCase
assert_equal(ticket.first_response_at.to_s, article_outbound.created_at.to_s, 'ticket.first_response_at 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_at, nil, 'ticket.close_at verify - outbound')
assert_nil(ticket.close_at, 'ticket.close_at verify - outbound')
delete = ticket.destroy
assert(delete, 'ticket destroy')
@ -450,9 +450,9 @@ class TicketSlaTest < ActiveSupport::TestCase
assert_equal(ticket.article_count, 1, 'ticket.article_count verify - inbound')
assert_equal(ticket.last_contact_at.to_s, article_inbound.created_at.to_s, 'ticket.last_contact_at verify - inbound')
assert_equal(ticket.last_contact_customer_at.to_s, article_inbound.created_at.to_s, 'ticket.last_contact_customer_at verify - inbound')
assert_equal(ticket.last_contact_agent_at, nil, 'ticket.last_contact_agent_at verify - inbound')
assert_equal(ticket.first_response_at, nil, 'ticket.first_response_at verify - inbound')
assert_equal(ticket.close_at, nil, 'ticket.close_at verify - inbound')
assert_nil(ticket.last_contact_agent_at, 'ticket.last_contact_agent_at verify - inbound')
assert_nil(ticket.first_response_at, 'ticket.first_response_at verify - inbound')
assert_nil(ticket.close_at, 'ticket.close_at verify - inbound')
# create note article
article_note = Ticket::Article.create!(
@ -473,9 +473,9 @@ class TicketSlaTest < ActiveSupport::TestCase
assert_equal(ticket.article_count, 2, 'ticket.article_count verify - inbound')
assert_equal(ticket.last_contact_at.to_s, article_inbound.created_at.to_s, 'ticket.last_contact_at verify - inbound')
assert_equal(ticket.last_contact_customer_at.to_s, article_inbound.created_at.to_s, 'ticket.last_contact_customer_at verify - inbound')
assert_equal(ticket.last_contact_agent_at, nil, 'ticket.last_contact_agent_at verify - inbound')
assert_equal(ticket.first_response_at, nil, 'ticket.first_response_at verify - inbound')
assert_equal(ticket.close_at, nil, 'ticket.close_at verify - inbound')
assert_nil(ticket.last_contact_agent_at, 'ticket.last_contact_agent_at verify - inbound')
assert_nil(ticket.first_response_at, 'ticket.first_response_at verify - inbound')
assert_nil(ticket.close_at, 'ticket.close_at verify - inbound')
# create outbound article
article_outbound = Ticket::Article.create!(
@ -498,7 +498,7 @@ class TicketSlaTest < ActiveSupport::TestCase
assert_equal(ticket.last_contact_customer_at.to_s, article_inbound.created_at.to_s, 'ticket.last_contact_customer_at verify - inbound')
assert_equal(ticket.last_contact_agent_at.to_s, article_outbound.created_at.to_s, 'ticket.last_contact_agent_at verify - inbound')
assert_equal(ticket.first_response_at.to_s, article_outbound.created_at.to_s, 'ticket.first_response_at verify - inbound')
assert_equal(ticket.close_at, nil, 'ticket.close_at verify - inbound')
assert_nil(ticket.close_at, 'ticket.close_at verify - inbound')
delete = sla.destroy
assert(delete, 'sla destroy')
@ -527,7 +527,7 @@ class TicketSlaTest < ActiveSupport::TestCase
created_by_id: 1,
)
assert(ticket, 'ticket created')
assert_equal(ticket.escalation_at, nil, 'ticket.escalation_at verify')
assert_nil(ticket.escalation_at, 'ticket.escalation_at verify')
# set sla's for timezone "Europe/Berlin" wintertime (+1), so UTC times are 7:00-16:00
calendar = Calendar.create_or_update(
@ -622,7 +622,7 @@ class TicketSlaTest < ActiveSupport::TestCase
created_by_id: 1,
)
assert(ticket, 'ticket created')
assert_equal(ticket.escalation_at, nil, 'ticket.escalation_at verify')
assert_nil(ticket.escalation_at, 'ticket.escalation_at verify')
# set sla's for timezone "Europe/Berlin" summertime (+2), so UTC times are 6:00-15:00
calendar = Calendar.create_or_update(
@ -712,7 +712,7 @@ class TicketSlaTest < ActiveSupport::TestCase
created_by_id: 1,
)
assert(ticket, 'ticket created')
assert_equal(ticket.escalation_at, nil, 'ticket.escalation_at verify')
assert_nil(ticket.escalation_at, 'ticket.escalation_at verify')
# set sla's for timezone "Europe/Berlin" summertime (+2), so UTC times are 6:00-15:00
sla = Sla.create_or_update(
@ -891,8 +891,8 @@ class TicketSlaTest < ActiveSupport::TestCase
ticket1 = Ticket.find(ticket1.id)
assert_equal(ticket1.escalation_at.gmtime.to_s, '2013-06-04 11:45:00 UTC', 'ticket1.escalation_at verify 1')
assert_equal(ticket1.first_response_escalation_at.gmtime.to_s, '2013-06-04 11:45:00 UTC', 'ticket1.first_response_escalation_at verify 1')
assert_equal(ticket1.first_response_in_min, nil, 'ticket1.first_response_in_min verify 3')
assert_equal(ticket1.first_response_diff_in_min, nil, 'ticket1.first_response_diff_in_min verify 3')
assert_nil(ticket1.first_response_in_min, 'ticket1.first_response_in_min verify 3')
assert_nil(ticket1.first_response_diff_in_min, 'ticket1.first_response_diff_in_min verify 3')
ticket2 = Ticket.create!(
title: 'some title äöüß4',
@ -940,8 +940,8 @@ class TicketSlaTest < ActiveSupport::TestCase
ticket2 = Ticket.find(ticket2.id)
assert_equal(ticket2.escalation_at.gmtime.to_s, '2013-06-04 16:00:00 UTC', 'ticket2.escalation_at verify 1')
assert_equal(ticket2.first_response_escalation_at.gmtime.to_s, '2013-06-04 16:00:00 UTC', 'ticket2.first_response_escalation_at verify 1')
assert_equal(ticket2.first_response_in_min, nil, 'ticket2.first_response_in_min verify 3')
assert_equal(ticket2.first_response_diff_in_min, nil, 'ticket2.first_response_diff_in_min verify 3')
assert_nil(ticket2.first_response_in_min, 'ticket2.first_response_in_min verify 3')
assert_nil(ticket2.first_response_diff_in_min, 'ticket2.first_response_diff_in_min verify 3')
delete = sla.destroy
assert(delete, 'sla destroy')
@ -1173,10 +1173,10 @@ class TicketSlaTest < ActiveSupport::TestCase
)
Scheduler.worker(true)
ticket = Ticket.find(ticket.id)
assert_equal(ticket.escalation_at, nil, 'ticket.escalation_at verify 1')
assert_nil(ticket.escalation_at, 'ticket.escalation_at verify 1')
assert_equal(ticket.first_response_escalation_at.gmtime.to_s, '2013-06-04 14:00:00 UTC', 'ticket.first_response_escalation_at verify 1')
assert_equal(ticket.first_response_in_min, nil, 'ticket.first_response_in_min verify 3')
assert_equal(ticket.first_response_diff_in_min, nil, 'ticket.first_response_diff_in_min verify 3')
assert_nil(ticket.first_response_in_min, 'ticket.first_response_in_min verify 3')
assert_nil(ticket.first_response_diff_in_min, 'ticket.first_response_diff_in_min verify 3')
assert_equal(ticket.update_escalation_at.gmtime.to_s, '2013-06-04 15:00:00 UTC', 'ticket.update_escalation_at verify 1')
assert_equal(ticket.close_escalation_at.gmtime.to_s, '2013-06-04 16:00:00 UTC', 'ticket.close_escalation_at verify 1')
assert_equal(ticket.close_in_min, 0, 'ticket.close_in_min verify 3')
@ -1300,10 +1300,10 @@ class TicketSlaTest < ActiveSupport::TestCase
)
Scheduler.worker(true)
ticket = Ticket.find(ticket.id)
assert_equal(ticket.escalation_at, nil, 'ticket.escalation_at verify 1')
assert_nil(ticket.escalation_at, 'ticket.escalation_at verify 1')
assert_equal(ticket.first_response_escalation_at.gmtime.to_s, '2013-06-04 13:30:00 UTC', 'ticket.first_response_escalation_at verify 1')
assert_equal(ticket.first_response_in_min, nil, 'ticket.first_response_in_min verify 3')
assert_equal(ticket.first_response_diff_in_min, nil, 'ticket.first_response_diff_in_min verify 3')
assert_nil(ticket.first_response_in_min, 'ticket.first_response_in_min verify 3')
assert_nil(ticket.first_response_diff_in_min, 'ticket.first_response_diff_in_min verify 3')
assert_equal(ticket.update_escalation_at.gmtime.to_s, '2013-06-04 14:30:00 UTC', 'ticket.update_escalation_at verify 1')
assert_equal(ticket.close_escalation_at.gmtime.to_s, '2013-06-04 15:30:00 UTC', 'ticket.close_escalation_at verify 1')
assert_equal(ticket.close_in_min, 30, 'ticket.close_in_min verify 3')
@ -1443,10 +1443,10 @@ class TicketSlaTest < ActiveSupport::TestCase
)
Scheduler.worker(true)
ticket = Ticket.find(ticket.id)
assert_equal(ticket.escalation_at, nil, 'ticket.escalation_at verify 1')
assert_nil(ticket.escalation_at, 'ticket.escalation_at verify 1')
assert_equal(ticket.first_response_escalation_at.gmtime.to_s, '2013-06-04 13:00:00 UTC', 'ticket.first_response_escalation_at verify 1')
assert_equal(ticket.first_response_in_min, nil, 'ticket.first_response_in_min verify 3')
assert_equal(ticket.first_response_diff_in_min, nil, 'ticket.first_response_diff_in_min verify 3')
assert_nil(ticket.first_response_in_min, 'ticket.first_response_in_min verify 3')
assert_nil(ticket.first_response_diff_in_min, 'ticket.first_response_diff_in_min verify 3')
assert_equal(ticket.update_escalation_at.gmtime.to_s, '2013-06-04 14:00:00 UTC', 'ticket.update_escalation_at verify 1')
assert_equal(ticket.close_escalation_at.gmtime.to_s, '2013-06-04 15:00:00 UTC', 'ticket.close_escalation_at verify 1')
assert_equal(ticket.close_in_min, 60, 'ticket.close_in_min verify 3')
@ -1551,12 +1551,12 @@ class TicketSlaTest < ActiveSupport::TestCase
ticket = Ticket.find(ticket.id)
assert_equal(ticket.escalation_at.gmtime.to_s, '2016-03-21 13:30:00 UTC', 'ticket.escalation_at verify 1')
assert_equal(ticket.first_response_escalation_at.gmtime.to_s, '2016-03-21 13:30:00 UTC', 'ticket.first_response_escalation_at verify 1')
assert_equal(ticket.first_response_in_min, nil, 'ticket.first_response_in_min verify 3')
assert_equal(ticket.first_response_diff_in_min, nil, 'ticket.first_response_diff_in_min verify 3')
assert_nil(ticket.first_response_in_min, 'ticket.first_response_in_min verify 3')
assert_nil(ticket.first_response_diff_in_min, 'ticket.first_response_diff_in_min verify 3')
assert_equal(ticket.update_escalation_at.gmtime.to_s, '2016-03-21 14:30:00 UTC', 'ticket.update_escalation_at verify 1')
assert_equal(ticket.close_escalation_at.gmtime.to_s, '2016-03-21 15:30:00 UTC', 'ticket.close_escalation_at verify 1')
assert_equal(ticket.close_in_min, nil, 'ticket.close_in_min verify 3')
assert_equal(ticket.close_diff_in_min, nil, 'ticket.close_diff_in_min# verify 3')
assert_nil(ticket.close_in_min, 'ticket.close_in_min verify 3')
assert_nil(ticket.close_diff_in_min, 'ticket.close_diff_in_min# verify 3')
sla = Sla.create_or_update(
name: 'test sla - ticket.title & article.subject',
@ -1581,12 +1581,12 @@ class TicketSlaTest < ActiveSupport::TestCase
ticket = Ticket.find(ticket.id)
assert_equal(ticket.escalation_at.gmtime.to_s, '2016-03-21 13:30:00 UTC', 'ticket.escalation_at verify 1')
assert_equal(ticket.first_response_escalation_at.gmtime.to_s, '2016-03-21 13:30:00 UTC', 'ticket.first_response_escalation_at verify 1')
assert_equal(ticket.first_response_in_min, nil, 'ticket.first_response_in_min verify 3')
assert_equal(ticket.first_response_diff_in_min, nil, 'ticket.first_response_diff_in_min verify 3')
assert_nil(ticket.first_response_in_min, 'ticket.first_response_in_min verify 3')
assert_nil(ticket.first_response_diff_in_min, 'ticket.first_response_diff_in_min verify 3')
assert_equal(ticket.update_escalation_at.gmtime.to_s, '2016-03-21 14:30:00 UTC', 'ticket.update_escalation_at verify 1')
assert_equal(ticket.close_escalation_at.gmtime.to_s, '2016-03-21 15:30:00 UTC', 'ticket.close_escalation_at verify 1')
assert_equal(ticket.close_in_min, nil, 'ticket.close_in_min verify 3')
assert_equal(ticket.close_diff_in_min, nil, 'ticket.close_diff_in_min# verify 3')
assert_nil(ticket.close_in_min, 'ticket.close_in_min verify 3')
assert_nil(ticket.close_diff_in_min, 'ticket.close_diff_in_min# verify 3')
sla = Sla.create_or_update(
name: 'test sla - ticket.title & article.subject',
@ -1609,14 +1609,14 @@ class TicketSlaTest < ActiveSupport::TestCase
)
Scheduler.worker(true)
ticket = Ticket.find(ticket.id)
assert_equal(ticket.escalation_at, nil, 'ticket.escalation_at verify 1')
assert_equal(ticket.first_response_escalation_at, nil, 'ticket.first_response_escalation_at verify 1')
assert_equal(ticket.first_response_in_min, nil, 'ticket.first_response_in_min verify 3')
assert_equal(ticket.first_response_diff_in_min, nil, 'ticket.first_response_diff_in_min verify 3')
assert_equal(ticket.update_escalation_at, nil, 'ticket.update_escalation_at verify 1')
assert_equal(ticket.close_escalation_at, nil, 'ticket.close_escalation_at verify 1')
assert_equal(ticket.close_in_min, nil, 'ticket.close_in_min verify 3')
assert_equal(ticket.close_diff_in_min, nil, 'ticket.close_diff_in_min# verify 3')
assert_nil(ticket.escalation_at, 'ticket.escalation_at verify 1')
assert_nil(ticket.first_response_escalation_at, 'ticket.first_response_escalation_at verify 1')
assert_nil(ticket.first_response_in_min, 'ticket.first_response_in_min verify 3')
assert_nil(ticket.first_response_diff_in_min, 'ticket.first_response_diff_in_min verify 3')
assert_nil(ticket.update_escalation_at, 'ticket.update_escalation_at verify 1')
assert_nil(ticket.close_escalation_at, 'ticket.close_escalation_at verify 1')
assert_nil(ticket.close_in_min, 'ticket.close_in_min verify 3')
assert_nil(ticket.close_diff_in_min, 'ticket.close_diff_in_min# verify 3')
delete = sla.destroy
assert(delete, 'sla destroy')
@ -1646,7 +1646,7 @@ class TicketSlaTest < ActiveSupport::TestCase
created_by_id: 1,
)
assert(ticket, 'ticket created')
assert_equal(ticket.escalation_at, nil, 'ticket.escalation_at verify')
assert_nil(ticket.escalation_at, 'ticket.escalation_at verify')
article_customer = Ticket::Article.create!(
ticket_id: ticket.id,
@ -1724,7 +1724,7 @@ class TicketSlaTest < ActiveSupport::TestCase
assert_equal(ticket.escalation_at.gmtime.to_s, '2016-11-02 09:00:00 UTC', 'ticket.escalation_at verify 1')
assert_equal(ticket.first_response_escalation_at.gmtime.to_s, '2016-11-02 09:00:00 UTC', 'ticket.first_response_escalation_at verify 1')
assert_equal(ticket.update_escalation_at.gmtime.to_s, '2016-11-03 15:00:00 UTC', 'ticket.update_escalation_at verify 1')
assert_equal(ticket.close_escalation_at, nil, 'ticket.close_escalation_at verify 1')
assert_nil(ticket.close_escalation_at, 'ticket.close_escalation_at verify 1')
ticket.state = Ticket::State.lookup(name: 'pending reminder')
ticket.pending_time = '2016-11-10 07:00:00 UTC'
@ -1749,10 +1749,10 @@ class TicketSlaTest < ActiveSupport::TestCase
Scheduler.worker(true)
ticket = Ticket.find(ticket.id)
assert_equal(ticket.escalation_at, nil, 'ticket.escalation_at verify 1')
assert_nil(ticket.escalation_at, 'ticket.escalation_at verify 1')
assert_equal(ticket.first_response_escalation_at.gmtime.to_s, '2016-11-02 09:00:00 UTC', 'ticket.first_response_escalation_at verify 1')
assert_equal(ticket.update_escalation_at.gmtime.to_s, '2016-11-03 15:00:00 UTC', 'ticket.update_escalation_at verify 1')
assert_equal(ticket.close_escalation_at, nil, 'ticket.close_escalation_at verify 1')
assert_nil(ticket.close_escalation_at, 'ticket.close_escalation_at verify 1')
ticket.state = Ticket::State.lookup(name: 'open')
ticket.updated_at = '2016-11-01 15:59:14 UTC'
@ -1779,7 +1779,7 @@ class TicketSlaTest < ActiveSupport::TestCase
assert_equal(ticket.escalation_at.gmtime.to_s, '2016-11-03 15:00:00 UTC', 'ticket.escalation_at verify 1')
assert_equal(ticket.first_response_escalation_at.gmtime.to_s, '2016-11-02 09:00:00 UTC', 'ticket.first_response_escalation_at verify 1')
assert_equal(ticket.update_escalation_at.gmtime.to_s, '2016-11-03 15:00:00 UTC', 'ticket.update_escalation_at verify 1')
assert_equal(ticket.close_escalation_at, nil, 'ticket.close_escalation_at verify 1')
assert_nil(ticket.close_escalation_at, 'ticket.close_escalation_at verify 1')
ticket.state = Ticket::State.lookup(name: 'pending reminder')
ticket.pending_time = '2016-11-18 07:00:00 UTC'
@ -1788,10 +1788,10 @@ class TicketSlaTest < ActiveSupport::TestCase
Scheduler.worker(true)
ticket = Ticket.find(ticket.id)
assert_equal(ticket.escalation_at, nil, 'ticket.escalation_at verify 1')
assert_nil(ticket.escalation_at, 'ticket.escalation_at verify 1')
assert_equal(ticket.first_response_escalation_at.gmtime.to_s, '2016-11-02 09:00:00 UTC', 'ticket.first_response_escalation_at verify 1')
assert_equal(ticket.update_escalation_at.gmtime.to_s, '2016-11-03 15:00:00 UTC', 'ticket.update_escalation_at verify 1')
assert_equal(ticket.close_escalation_at, nil, 'ticket.close_escalation_at verify 1')
assert_nil(ticket.close_escalation_at, 'ticket.close_escalation_at verify 1')
ticket.state = Ticket::State.lookup(name: 'open')
ticket.updated_at = '2016-11-07 13:26:36 UTC'
@ -1818,7 +1818,7 @@ class TicketSlaTest < ActiveSupport::TestCase
assert_equal(ticket.escalation_at.gmtime.to_s, '2016-11-09 09:27:00 UTC', 'ticket.escalation_at verify 1')
assert_equal(ticket.first_response_escalation_at.gmtime.to_s, '2016-11-02 09:00:00 UTC', 'ticket.first_response_escalation_at verify 1')
assert_equal(ticket.update_escalation_at.gmtime.to_s, '2016-11-09 09:27:00 UTC', 'ticket.update_escalation_at verify 1')
assert_equal(ticket.close_escalation_at, nil, 'ticket.close_escalation_at verify 1')
assert_nil(ticket.close_escalation_at, 'ticket.close_escalation_at verify 1')
article_agent = Ticket::Article.create!(
ticket_id: ticket.id,
@ -1841,7 +1841,7 @@ class TicketSlaTest < ActiveSupport::TestCase
assert_equal(ticket.escalation_at.gmtime.to_s, '2016-11-09 10:26:36 UTC', 'ticket.escalation_at verify 1')
assert_equal(ticket.first_response_escalation_at.gmtime.to_s, '2016-11-02 09:00:00 UTC', 'ticket.first_response_escalation_at verify 1')
assert_equal(ticket.update_escalation_at.gmtime.to_s, '2016-11-09 10:26:36 UTC', 'ticket.update_escalation_at verify 1')
assert_equal(ticket.close_escalation_at, nil, 'ticket.close_escalation_at verify 1')
assert_nil(ticket.close_escalation_at, 'ticket.close_escalation_at verify 1')
delete = sla.destroy
assert(delete, 'sla destroy')
@ -1870,7 +1870,7 @@ class TicketSlaTest < ActiveSupport::TestCase
created_by_id: 1,
)
assert(ticket, 'ticket created')
assert_equal(ticket.escalation_at, nil, 'ticket.escalation_at verify')
assert_nil(ticket.escalation_at, 'ticket.escalation_at verify')
article_customer = Ticket::Article.create!(
ticket_id: ticket.id,
@ -1948,7 +1948,7 @@ class TicketSlaTest < ActiveSupport::TestCase
assert_equal(ticket.escalation_at.gmtime.to_s, '2016-11-02 08:00:00 UTC', 'ticket.escalation_at verify 1')
assert_equal(ticket.first_response_escalation_at.gmtime.to_s, '2016-11-02 08:00:00 UTC', 'ticket.first_response_escalation_at verify 1')
assert_equal(ticket.update_escalation_at.gmtime.to_s, '2016-11-02 09:00:00 UTC', 'ticket.update_escalation_at verify 1')
assert_equal(ticket.close_escalation_at, nil, 'ticket.close_escalation_at verify 1')
assert_nil(ticket.close_escalation_at, 'ticket.close_escalation_at verify 1')
article_agent = Ticket::Article.create!(
ticket_id: ticket.id,
@ -1971,7 +1971,7 @@ class TicketSlaTest < ActiveSupport::TestCase
assert_equal(ticket.escalation_at.gmtime.to_s, '2016-11-07 15:26:36 UTC', 'ticket.escalation_at verify 1')
assert_equal(ticket.first_response_escalation_at.gmtime.to_s, '2016-11-02 08:00:00 UTC', 'ticket.first_response_escalation_at verify 1')
assert_equal(ticket.update_escalation_at.gmtime.to_s, '2016-11-07 15:26:36 UTC', 'ticket.update_escalation_at verify 1')
assert_equal(ticket.close_escalation_at, nil, 'ticket.close_escalation_at verify 1')
assert_nil(ticket.close_escalation_at, 'ticket.close_escalation_at verify 1')
# set sla's for timezone "Europe/Berlin" wintertime (+1), so UTC times are 3:00-18:00
calendar.update_attributes(
@ -2022,7 +2022,7 @@ class TicketSlaTest < ActiveSupport::TestCase
assert_equal(ticket.escalation_at.gmtime.to_s, '2016-11-07 15:26:36 UTC', 'ticket.escalation_at verify 1')
assert_equal(ticket.first_response_escalation_at.gmtime.to_s, '2016-11-02 04:00:00 UTC', 'ticket.first_response_escalation_at verify 1')
assert_equal(ticket.update_escalation_at.gmtime.to_s, '2016-11-07 15:26:36 UTC', 'ticket.update_escalation_at verify 1')
assert_equal(ticket.close_escalation_at, nil, 'ticket.close_escalation_at verify 1')
assert_nil(ticket.close_escalation_at, 'ticket.close_escalation_at verify 1')
delete = sla.destroy
assert(delete, 'sla destroy')

View file

@ -38,9 +38,9 @@ class TicketTest < ActiveSupport::TestCase
assert_equal(ticket.article_count, 1, 'ticket.article_count verify - inbound')
assert_equal(ticket.last_contact_at.to_s, article_inbound1.created_at.to_s, 'ticket.last_contact verify - inbound')
assert_equal(ticket.last_contact_customer_at.to_s, article_inbound1.created_at.to_s, 'ticket.last_contact_customer_at verify - inbound')
assert_equal(ticket.last_contact_agent_at, nil, 'ticket.last_contact_agent_at verify - inbound')
assert_equal(ticket.first_response_at, nil, 'ticket.first_response_at verify - inbound')
assert_equal(ticket.close_at, nil, 'ticket.close_at verify - inbound')
assert_nil(ticket.last_contact_agent_at, 'ticket.last_contact_agent_at verify - inbound')
assert_nil(ticket.first_response_at, 'ticket.first_response_at verify - inbound')
assert_nil(ticket.close_at, 'ticket.close_at verify - inbound')
# create inbound article #2
travel 2.seconds
@ -63,9 +63,9 @@ class TicketTest < ActiveSupport::TestCase
assert_equal(ticket.article_count, 2, 'ticket.article_count verify - inbound')
assert_equal(ticket.last_contact_at.to_s, article_inbound1.created_at.to_s, 'ticket.last_contact verify - inbound')
assert_equal(ticket.last_contact_customer_at.to_s, article_inbound1.created_at.to_s, 'ticket.last_contact_customer_at verify - inbound')
assert_equal(ticket.last_contact_agent_at, nil, 'ticket.last_contact_agent_at verify - inbound')
assert_equal(ticket.first_response_at, nil, 'ticket.first_response_at verify - inbound')
assert_equal(ticket.close_at, nil, 'ticket.close_at verify - inbound')
assert_nil(ticket.last_contact_agent_at, 'ticket.last_contact_agent_at verify - inbound')
assert_nil(ticket.first_response_at, 'ticket.first_response_at verify - inbound')
assert_nil(ticket.close_at, 'ticket.close_at verify - inbound')
# create note article
article_note = Ticket::Article.create(
@ -86,9 +86,9 @@ class TicketTest < ActiveSupport::TestCase
assert_equal(ticket.article_count, 3, 'ticket.article_count verify - note')
assert_equal(ticket.last_contact_at.to_s, article_inbound1.created_at.to_s, 'ticket.last_contact verify - note')
assert_equal(ticket.last_contact_customer_at.to_s, article_inbound1.created_at.to_s, 'ticket.last_contact_customer_at verify - note')
assert_equal(ticket.last_contact_agent_at, nil, 'ticket.last_contact_agent_at verify - note')
assert_equal(ticket.first_response_at, nil, 'ticket.first_response_at verify - note')
assert_equal(ticket.close_at, nil, 'ticket.close_at verify - note')
assert_nil(ticket.last_contact_agent_at, 'ticket.last_contact_agent_at verify - note')
assert_nil(ticket.first_response_at, 'ticket.first_response_at verify - note')
assert_nil(ticket.close_at, 'ticket.close_at verify - note')
# create outbound article
travel 2.seconds
@ -112,7 +112,7 @@ class TicketTest < ActiveSupport::TestCase
assert_equal(ticket.last_contact_customer_at.to_s, article_inbound1.created_at.to_s, 'ticket.last_contact_customer_at verify - outbound')
assert_equal(ticket.last_contact_agent_at.to_s, article_outbound.created_at.to_s, 'ticket.last_contact_agent_at verify - outbound')
assert_equal(ticket.first_response_at.to_s, article_outbound.created_at.to_s, 'ticket.first_response_at verify - outbound')
assert_equal(ticket.close_at, nil, 'ticket.close_at verify - outbound')
assert_nil(ticket.close_at, 'ticket.close_at verify - outbound')
# create inbound article #3
article_inbound3 = Ticket::Article.create(
@ -136,7 +136,7 @@ class TicketTest < ActiveSupport::TestCase
assert_equal(ticket.last_contact_customer_at.to_s, article_inbound3.created_at.to_s, 'ticket.last_contact_customer_at verify - inbound')
assert_equal(ticket.last_contact_agent_at.to_s, article_outbound.created_at.to_s, 'ticket.last_contact_agent_at verify - outbound')
assert_equal(ticket.first_response_at.to_s, article_outbound.created_at.to_s, 'ticket.first_response_at verify - outbound')
assert_equal(ticket.close_at, nil, 'ticket.close_at verify - outbound')
assert_nil(ticket.close_at, 'ticket.close_at verify - outbound')
# create inbound article #4
travel 2.seconds
@ -161,7 +161,7 @@ class TicketTest < ActiveSupport::TestCase
assert_equal(ticket.last_contact_customer_at.to_s, article_inbound3.created_at.to_s, 'ticket.last_contact_customer_at verify - inbound')
assert_equal(ticket.last_contact_agent_at.to_s, article_outbound.created_at.to_s, 'ticket.last_contact_agent_at verify - outbound')
assert_equal(ticket.first_response_at.to_s, article_outbound.created_at.to_s, 'ticket.first_response_at verify - outbound')
assert_equal(ticket.close_at, nil, 'ticket.close_at verify - outbound')
assert_nil(ticket.close_at, 'ticket.close_at verify - outbound')
ticket.state_id = Ticket::State.where(name: 'closed').first.id
ticket.save
@ -189,7 +189,7 @@ class TicketTest < ActiveSupport::TestCase
ticket = Ticket.find(ticket.id)
assert_equal(ticket.state.name, 'closed', 'state verify')
assert_equal(ticket.pending_time, nil)
assert_nil(ticket.pending_time)
# delete article
article_note = Ticket::Article.create(

View file

@ -32,7 +32,7 @@ class TokenTest < ActiveSupport::TestCase
user_id: agent1.id,
)
assert(token)
assert_equal(nil, token.persistent)
assert_nil(token.persistent)
user = Token.check(
action: 'PasswordReset_NotExisting',
name: token.name,