From 36ed006f29a2296097c77e43868e53f97080b115 Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Sat, 5 Dec 2015 20:55:34 +0100 Subject: [PATCH] Added browser tests for customer chat. --- .../event/chat_session_leave_temporary.rb | 17 +++++++++++++++++ script/build/test_slice_tests.sh | 2 +- 2 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 lib/sessions/event/chat_session_leave_temporary.rb diff --git a/lib/sessions/event/chat_session_leave_temporary.rb b/lib/sessions/event/chat_session_leave_temporary.rb new file mode 100644 index 000000000..42d589993 --- /dev/null +++ b/lib/sessions/event/chat_session_leave_temporary.rb @@ -0,0 +1,17 @@ +class Sessions::Event::ChatSessionLeaveTemporary < Sessions::Event::ChatBase + + def run + return if !check_chat_session_exists + chat_session = current_chat_session + + Delayed::Job.enqueue( + Observer::Chat::Leave::BackgroundJob.new(chat_session.id, @client_id, @session), + { + run_at: Time.zone.now + 0.5.minutes + } + ) + + false + end + +end diff --git a/script/build/test_slice_tests.sh b/script/build/test_slice_tests.sh index 2ac73ad18..09b79c2c4 100755 --- a/script/build/test_slice_tests.sh +++ b/script/build/test_slice_tests.sh @@ -8,6 +8,7 @@ if [ "$LEVEL" == '1' ]; then rm test/browser/agent_user_profile_test.rb rm test/browser/agent_organization_profile_test.rb rm test/browser/agent_ticket_*.rb + rm test/browser/chat_test.rb rm test/browser/prefereces_test.rb rm test/browser/setting_test.rb @@ -40,7 +41,6 @@ elif [ "$LEVEL" == '3' ]; then rm test/browser/agent_user_manage_test.rb rm test/browser/agent_ticket_*.rb rm test/browser/auth_test.rb - rm test/browser/chat_test.rb rm test/browser/customer_ticket_create_test.rb rm test/browser/maintenance_message_test.rb rm test/browser/manage_test.rb