Fixed issue #2118 - A ticket created by customer via web with state new is set to open on second update by customer.

This commit is contained in:
Martin Edenhofer 2018-07-06 14:30:12 +02:00
parent dd48e4dae5
commit 468b5bf12e
2 changed files with 19 additions and 2 deletions

View file

@ -633,6 +633,11 @@ class App.TicketZoom extends App.Controller
# and the default is was not set before # and the default is was not set before
return if @isDefaultFollowUpStateSet return if @isDefaultFollowUpStateSet
# and only if ticket is not in "new" state
if @ticket && @ticket.state_id
state = App.TicketState.findByAttribute('id', @ticket.state_id)
return if state && state.default_create is true
# prevent multiple changes for the default follow up state # prevent multiple changes for the default follow up state
@isDefaultFollowUpStateSet = true @isDefaultFollowUpStateSet = true

View file

@ -2,7 +2,7 @@
require 'browser_test_helper' require 'browser_test_helper'
class CustomerTicketCreateTest < TestCase class CustomerTicketCreateTest < TestCase
def test_customer_ticket_create def test_customer_ticket_create_and_verify_state_after_update
@browser = browser_instance @browser = browser_instance
login( login(
username: 'nicole.braun@zammad.org', username: 'nicole.braun@zammad.org',
@ -47,6 +47,12 @@ class CustomerTicketCreateTest < TestCase
no_quote: true, no_quote: true,
) )
# verify if the state has changed to open
match(
css: '.content.active .sidebar [name="state_id"]',
value: 'new',
)
# update ticket # update ticket
set( set(
css: '.content.active [data-name="body"]', css: '.content.active [data-name="body"]',
@ -65,6 +71,12 @@ class CustomerTicketCreateTest < TestCase
value: 'some body 1234 äöüß', value: 'some body 1234 äöüß',
) )
# check if the ticket state is new after update by customer
match(
css: '.content.active .sidebar [name="state_id"]',
value: 'new',
)
# now we want to verify the default followup state # now we want to verify the default followup state
# for this case we close the ticket first and then # for this case we close the ticket first and then
# write a new article. If the content is written # write a new article. If the content is written
@ -153,7 +165,7 @@ class CustomerTicketCreateTest < TestCase
) )
end end
def test_customer_ticket_create_relogin_with_agent_ticket_crearte def test_customer_ticket_create_relogin_with_agent_ticket_create
@browser = browser_instance @browser = browser_instance
login( login(
username: 'nicole.braun@zammad.org', username: 'nicole.braun@zammad.org',