From 754840470ffab58873b9f1e8a8473b872bceb513 Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Thu, 5 Jun 2014 09:52:56 +0200 Subject: [PATCH] Take email to from in create screen. --- .../controllers/agent_ticket_create.js.coffee | 2 + .../agent_ticket_actions_level3_test.rb | 6 +-- test/browser/agent_user_manage_test.rb | 48 +++++++++++++++++-- 3 files changed, 48 insertions(+), 8 deletions(-) diff --git a/app/assets/javascripts/app/controllers/agent_ticket_create.js.coffee b/app/assets/javascripts/app/controllers/agent_ticket_create.js.coffee index 5660252df..57fd1ec0a 100644 --- a/app/assets/javascripts/app/controllers/agent_ticket_create.js.coffee +++ b/app/assets/javascripts/app/controllers/agent_ticket_create.js.coffee @@ -361,6 +361,8 @@ class UserNew extends App.ControllerModal # force to reload object callbackReload = (user) -> realname = user.displayName() + if user.email + realname = "#{ realname } <#{ user.email }>" ui.create_screen.el.find('[name=customer_id]').val( user.id ) ui.create_screen.el.find('[name=customer_id_autocompletion]').val( realname ) diff --git a/test/browser/agent_ticket_actions_level3_test.rb b/test/browser/agent_ticket_actions_level3_test.rb index d5527211f..e39f723df 100644 --- a/test/browser/agent_ticket_actions_level3_test.rb +++ b/test/browser/agent_ticket_actions_level3_test.rb @@ -106,7 +106,7 @@ class AgentTicketActionsLevel3Test < TestCase }, { :execute => 'wait', - :value => 4, + :value => 5, }, { :where => :instance2, @@ -122,7 +122,7 @@ class AgentTicketActionsLevel3Test < TestCase }, { :execute => 'wait', - :value => 8, + :value => 10, }, { :where => :instance2, @@ -173,7 +173,7 @@ class AgentTicketActionsLevel3Test < TestCase }, { :execute => 'wait', - :value => 8, + :value => 14, }, # check content in instance 2 diff --git a/test/browser/agent_user_manage_test.rb b/test/browser/agent_user_manage_test.rb index 1b8b75aaa..045eac769 100644 --- a/test/browser/agent_user_manage_test.rb +++ b/test/browser/agent_user_manage_test.rb @@ -4,6 +4,9 @@ require 'browser_test_helper' class AgentUserManageTest < TestCase def test_agent_user customer_user_email = 'customer-test-' + rand(999999).to_s + '@example.com' + firstname = 'Customer Firstname' + lastname = 'Customer Lastname' + fullname = "#{ firstname } #{ lastname } <#{ customer_user_email }>" tests = [ { :name => 'create customer', @@ -34,12 +37,12 @@ class AgentUserManageTest < TestCase { :execute => 'set', :css => '.modal input[name="firstname"]', - :value => 'Customer Firstname', + :value => firstname, }, { :execute => 'set', :css => '.modal input[name="lastname"]', - :value => 'Customer Lastname', + :value => lastname, }, { :execute => 'set', @@ -66,7 +69,28 @@ class AgentUserManageTest < TestCase { :execute => 'match', :css => '.active input[name="customer_id_autocompletion"]', - :value => 'Customer', + :value => firstname, + :no_quote => true, + :match_result => true, + }, + { + :execute => 'match', + :css => '.active input[name="customer_id_autocompletion"]', + :value => lastname, + :no_quote => true, + :match_result => true, + }, + { + :execute => 'match', + :css => '.active input[name="customer_id_autocompletion"]', + :value => customer_user_email, + :no_quote => true, + :match_result => true, + }, + { + :execute => 'match', + :css => '.active input[name="customer_id_autocompletion"]', + :value => fullname, :no_quote => true, :match_result => true, }, @@ -112,7 +136,7 @@ class AgentUserManageTest < TestCase { :execute => 'match', :css => '.active input[name="customer_id_autocompletion"]', - :value => 'Customer', + :value => firstname, :no_quote => true, :match_result => false, }, @@ -149,7 +173,21 @@ class AgentUserManageTest < TestCase { :execute => 'match', :css => '.active input[name="customer_id_autocompletion"]', - :value => 'Customer', + :value => firstname, + :no_quote => true, + :match_result => true, + }, + { + :execute => 'match', + :css => '.active input[name="customer_id_autocompletion"]', + :value => lastname, + :no_quote => true, + :match_result => true, + }, + { + :execute => 'match', + :css => '.active input[name="customer_id_autocompletion"]', + :value => fullname, :no_quote => true, :match_result => true, },