From 82386abaf8f818a64cd730b9af0e0cfa97a6d0ae Mon Sep 17 00:00:00 2001 From: radhika Date: Thu, 14 Aug 2014 14:43:24 -0400 Subject: [PATCH] 3112: report issue works for no user and inactive user cases. --- apps/workbench/app/controllers/application_controller.rb | 4 ++-- .../workbench/app/views/issue_reporter/send_report.text.erb | 4 ++++ apps/workbench/test/integration/application_layout_test.rb | 6 ++---- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/apps/workbench/app/controllers/application_controller.rb b/apps/workbench/app/controllers/application_controller.rb index 222888085d..e018363561 100644 --- a/apps/workbench/app/controllers/application_controller.rb +++ b/apps/workbench/app/controllers/application_controller.rb @@ -11,9 +11,9 @@ class ApplicationController < ActionController::Base around_filter :set_thread_api_token # Methods that don't require login should # skip_around_filter :require_thread_api_token - around_filter :require_thread_api_token, except: ERROR_ACTIONS + around_filter :require_thread_api_token, except: [:report_issue_popup, :report_issue] + ERROR_ACTIONS before_filter :accept_uuid_as_id_param, except: ERROR_ACTIONS - before_filter :check_user_agreements, except: ERROR_ACTIONS + before_filter :check_user_agreements, except: [:report_issue_popup, :report_issue] + ERROR_ACTIONS before_filter :check_user_profile, except: [:update_profile] + ERROR_ACTIONS before_filter :check_user_notifications, except: ERROR_ACTIONS before_filter :load_filters_and_paging_params, except: ERROR_ACTIONS diff --git a/apps/workbench/app/views/issue_reporter/send_report.text.erb b/apps/workbench/app/views/issue_reporter/send_report.text.erb index 9afd1d2252..466d0915b6 100644 --- a/apps/workbench/app/views/issue_reporter/send_report.text.erb +++ b/apps/workbench/app/views/issue_reporter/send_report.text.erb @@ -1,4 +1,8 @@ +<% if @user %> Issue reported by user <%=@user.full_name%> <%=@user.email%> +<% else %> +Issue reported +<% end %> Details of the report: <% json_map = JSON.parse(@params['report_additional_info']).map %> diff --git a/apps/workbench/test/integration/application_layout_test.rb b/apps/workbench/test/integration/application_layout_test.rb index 9b1085a327..5fe86cc401 100644 --- a/apps/workbench/test/integration/application_layout_test.rb +++ b/apps/workbench/test/integration/application_layout_test.rb @@ -64,7 +64,7 @@ class ApplicationLayoutTest < ActionDispatch::IntegrationTest end # test the help menu - def check_help_menu user + def check_help_menu within('.navbar-fixed-top') do page.find("#arv-help").click within('.dropdown-menu') do @@ -79,7 +79,6 @@ class ApplicationLayoutTest < ActionDispatch::IntegrationTest end end - if user && user['is_active'] # TBD - no user as well as inactive user also should be able to report issue within '.modal-content' do assert page.has_text? 'Version / debugging info' assert page.has_no_text? 'Report a problem' @@ -119,7 +118,6 @@ class ApplicationLayoutTest < ActionDispatch::IntegrationTest page.find_field('report_text').set 'my test report text' click_button 'Report issue' end - end # TBD - when no user and inactive user work, this should go away assert page.has_no_text? 'Version / debugging info' end @@ -356,7 +354,7 @@ class ApplicationLayoutTest < ActionDispatch::IntegrationTest visit page_with_token(token) end - check_help_menu user + check_help_menu end end -- 2.30.2