5493: test uncovered an issue with getting_started_shown handling; fixed it.
authorRadhika Chippada <radhika@curoverse.com>
Tue, 31 Mar 2015 19:21:21 +0000 (15:21 -0400)
committerRadhika Chippada <radhika@curoverse.com>
Tue, 31 Mar 2015 19:21:21 +0000 (15:21 -0400)
apps/workbench/app/controllers/actions_controller.rb
apps/workbench/app/views/layouts/body.html.erb
apps/workbench/app/views/users/profile.html.erb
apps/workbench/test/integration/application_layout_test.rb
apps/workbench/test/integration/report_issue_test.rb
apps/workbench/test/integration/user_profile_test.rb

index 9db8827c16ba821fab41576ab8fd4509ec63ae11..d1c7f42fcb6c41b24437a82f14032943d9cc85c3 100644 (file)
@@ -1,6 +1,6 @@
 class ActionsController < ApplicationController
 
-  skip_filter :require_thread_api_token, only: [:report_issue_popup, :report_issue, :getting_started_popup]
+  skip_filter :require_thread_api_token, only: [:report_issue_popup, :report_issue]
   skip_filter :check_user_agreements, only: [:report_issue_popup, :report_issue]
 
   @@exposed_actions = {}
index e126cabd9c93317a004d074a622e085e0cee1b36..b0a54c923ac8536fbd84d3f91694eb1f3ff7c454 100644 (file)
     <% end %>
 
     <%= render partial: 'browser_unsupported' %><%# requires JS support below %>
-    <%= render partial: 'getting_started_popup' %><%# requires JS support below %>
+    <%= render partial: 'getting_started_popup' %>
 
     <div id="page-wrapper">
       <%= yield %>
index 82c2c15e409178b0fca809f9f5e90eaa43881df6..4fefa821caafb88be0a7647112514f98fa7c55f8 100644 (file)
@@ -16,7 +16,7 @@
         <div class="panel-body">
           <% if !missing_required_profile? && params[:offer_return_to] %>
             <div class="alert alert-success">
-              <% if current_user.prefs['getting_started_shown'] %>
+              <% if current_user.prefs[:getting_started_shown] %>
                 <p>Thank you for filling in your profile. <%= link_to 'Back to work!', params[:offer_return_to], class: 'btn btn-sm btn-primary' %></p>
               <% else %>
                 <p>Thank you for filling in your profile. <%= link_to 'Get started', params[:offer_return_to], class: 'btn btn-sm btn-primary' %></p>
index 667fd30f46253c3450e02981b550b61c9c89fe66..ed65563a7096655f5fbeb50a2f954ea7ab548a94 100644 (file)
@@ -110,8 +110,6 @@ class ApplicationLayoutTest < ActionDispatch::IntegrationTest
     ['active_no_prefs', api_fixture('users')['active_no_prefs'], true, false],
     ['active_no_prefs_profile_no_getting_started_shown',
         api_fixture('users')['active_no_prefs_profile_no_getting_started_shown'], true, false],
-    ['active_no_prefs_profile_with_getting_started_shown',
-        api_fixture('users')['active_no_prefs_profile_with_getting_started_shown'], true, false],
   ].each do |token, user, invited, has_profile|
 
     test "visit home page for user #{token}" do
@@ -164,13 +162,11 @@ class ApplicationLayoutTest < ActionDispatch::IntegrationTest
       assert_no_selector 'button:not([disabled])', text: 'Prev'  # Prev button is again disabled
 
       # Click Next until last page is reached and verify that it is disabled
-      foundDisabledNext = false
       (0..20).each do |i|   # currently we only have 4 pages, and don't expect to have more than 20 in future
         click_button 'Next'
         begin
           find('button:not([disabled])', text: 'Next')
         rescue => e
-          foundDisabledNext = true if e.message.include?('Unable to find')
           break
         end
       end
index 732b7784e7a5f771ce62f03edeb97a4d49a4bd7f..4e1920a939de88d67ffb7cabee8f40ae3c482caa 100644 (file)
@@ -86,8 +86,6 @@ class ReportIssueTest < ActionDispatch::IntegrationTest
     ['active_no_prefs', api_fixture('users')['active_no_prefs']],
     ['active_no_prefs_profile_no_getting_started_shown',
         api_fixture('users')['active_no_prefs_profile_no_getting_started_shown']],
-    ['active_no_prefs_profile_with_getting_started_shown',
-        api_fixture('users')['active_no_prefs_profile_with_getting_started_shown']],
   ].each do |token, user|
 
     test "check version info and report issue for user #{token}" do
index 3d17fd2796d7241fde6b1689056211eaa8bc2d82..9fa7afa8f0b2fb769fa9c81de914ad8f04658b16 100644 (file)
@@ -10,7 +10,7 @@ class UserProfileTest < ActionDispatch::IntegrationTest
     Rails.configuration.user_profile_form_fields = @user_profile_form_fields
   end
 
-  def verify_homepage_with_profile user, invited, has_profile, getting_started_shown=false
+  def verify_homepage_with_profile user, invited, has_profile
     profile_config = Rails.configuration.user_profile_form_fields
 
     if !user
@@ -18,7 +18,7 @@ class UserProfileTest < ActionDispatch::IntegrationTest
     elsif user['is_active']
       if profile_config && !has_profile
         assert page.has_text?('Save profile'), 'No text - Save profile'
-        add_profile user, invited, has_profile, getting_started_shown
+        add_profile user
       else
         assert page.has_text?('Active pipelines'), 'Not found text - Active pipelines'
         assert page.has_no_text?('Save profile'), 'Found text - Save profile'
@@ -69,7 +69,7 @@ class UserProfileTest < ActionDispatch::IntegrationTest
   end
 
   # Check manage profile page and add missing profile to the user
-  def add_profile user, invited, has_profile, getting_started_shown
+  def add_profile user
     assert page.has_no_text?('My projects'), 'Found text - My projects'
     assert page.has_no_text?('Projects shared with me'), 'Found text - Projects shared with me'
 
@@ -109,7 +109,7 @@ class UserProfileTest < ActionDispatch::IntegrationTest
     click_button "Save profile"
     # profile saved and in profile page now with success
     assert page.has_text?('Thank you for filling in your profile'), 'No text - Thank you for filling'
-    if getting_started_shown
+    if user['prefs']['getting_started_shown']
       click_link 'Back to work!'
     else
       click_link 'Get started'
@@ -129,7 +129,7 @@ class UserProfileTest < ActionDispatch::IntegrationTest
     ['active_no_prefs_profile_no_getting_started_shown',
       api_fixture('users')['active_no_prefs_profile_no_getting_started_shown'], true, false],
     ['active_no_prefs_profile_with_getting_started_shown',
-      api_fixture('users')['active_no_prefs_profile_with_getting_started_shown'], true, false, true],
+      api_fixture('users')['active_no_prefs_profile_with_getting_started_shown'], true, false],
   ].each do |token, user, invited, has_profile|
 
     test "visit home page when profile is configured for user #{token}" do