3112: report issue works for no user and inactive user cases.
authorradhika <radhika@curoverse.com>
Thu, 14 Aug 2014 18:43:24 +0000 (14:43 -0400)
committerradhika <radhika@curoverse.com>
Thu, 14 Aug 2014 18:43:24 +0000 (14:43 -0400)
apps/workbench/app/controllers/application_controller.rb
apps/workbench/app/views/issue_reporter/send_report.text.erb
apps/workbench/test/integration/application_layout_test.rb

index 222888085d9e3bb95973f2a2865c3efbb569b7f5..e0183635610d99a1def0e0df254ff1c1e14d38bd 100644 (file)
@@ -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
index 9afd1d2252a1c3d9be78175721f242ecd8d0817f..466d0915b650137005d5ed088a972683a10fba24 100644 (file)
@@ -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 %>
index 9b1085a327187c2bfd38e05a842bec126b36548c..5fe86cc401adec5818aad3aefd8f60310c819ea1 100644 (file)
@@ -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