Fixed tests, applied new auto reply.

This commit is contained in:
Martin Edenhofer 2016-05-05 17:09:35 +02:00
parent 27584484c4
commit aba3664263
4 changed files with 47 additions and 6 deletions

View file

@ -13,7 +13,7 @@ class UpdateTrigger < ActiveRecord::Migration
},
'ticket.state_id' => {
'operator' => 'is not',
'value' => '4',
'value' => Ticket::State.lookup(name: 'closed').id,
},
'article.type_id' => {
'operator' => 'is',
@ -23,6 +23,10 @@ class UpdateTrigger < ActiveRecord::Migration
Ticket::Article::Type.lookup(name: 'web').id,
],
},
'article.sender_id' => {
'operator' => 'is',
'value' => Ticket::Article::Sender.lookup(name: 'Customer').id,
},
},
perform: {
'notification.email' => {

View file

@ -0,0 +1,33 @@
class UpdateTrigger2 < ActiveRecord::Migration
def up
# return if it's a new setup
return if !Setting.find_by(name: 'system_init_done')
trigger = Trigger.find_by(name: 'auto reply (on new tickets)')
return if !trigger
trigger.condition = {
'ticket.action' => {
'operator' => 'is',
'value' => 'create',
},
'ticket.state_id' => {
'operator' => 'is not',
'value' => Ticket::State.lookup(name: 'closed').id,
},
'article.type_id' => {
'operator' => 'is',
'value' => [
Ticket::Article::Type.lookup(name: 'email').id,
Ticket::Article::Type.lookup(name: 'phone').id,
Ticket::Article::Type.lookup(name: 'web').id,
],
},
'article.sender_id' => {
'operator' => 'is',
'value' => Ticket::Article::Sender.lookup(name: 'Customer').id,
},
}
trigger.save
end
end

View file

@ -3865,7 +3865,7 @@ Trigger.create_or_update(
},
'ticket.state_id' => {
'operator' => 'is not',
'value' => '4',
'value' => Ticket::State.lookup(name: 'closed').id,
},
'article.type_id' => {
'operator' => 'is',
@ -3875,6 +3875,10 @@ Trigger.create_or_update(
Ticket::Article::Type.lookup(name: 'web').id,
],
},
'article.sender_id' => {
'operator' => 'is',
'value' => Ticket::Article::Sender.lookup(name: 'Customer').id,
},
},
perform: {
'notification.email' => {

View file

@ -121,11 +121,11 @@ class AgentTicketActionLevel6Test < TestCase
value: 'test 6 - ticket 1-1',
)
match_not(
css: '.active .ticket-article-item:nth-child(2) .attachments',
css: '.active .ticket-article-item:nth-child(3) .attachments',
value: 'upload2.jpg',
)
match(
css: '.active .ticket-article-item:nth-child(2) .attachments',
css: '.active .ticket-article-item:nth-child(3) .attachments',
value: 'upload1.txt',
)
@ -176,11 +176,11 @@ class AgentTicketActionLevel6Test < TestCase
},
)
match(
css: '.active .ticket-article-item:nth-child(3) .attachments',
css: '.active .ticket-article-item:nth-child(4) .attachments',
value: 'upload2.jpg',
)
match(
css: '.active .ticket-article-item:nth-child(3) .attachments',
css: '.active .ticket-article-item:nth-child(4) .attachments',
value: 'upload1.txt',
)
#