Merge branch 'master' into 6588-split-manage-account
[arvados.git] / apps / workbench / test / integration / user_profile_test.rb
index 3d17fd2796d7241fde6b1689056211eaa8bc2d82..05f3c65db71ce50d1ecb6c4ff39c930515b15cfc 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'
@@ -47,14 +47,17 @@ class UserProfileTest < ActionDispatch::IntegrationTest
         assert page.has_link?('Log in'), 'Not found link - Log in'
       else
         # my account menu
-        assert page.has_link?("#{user['email']}"), 'Not found link - email'
-        find('a', text: "#{user['email']}").click
+        assert(page.has_link?("notifications-menu"), 'no user menu')
+        page.find("#notifications-menu").click
         within('.dropdown-menu') do
           if user['is_active']
             assert page.has_no_link?('Not active'), 'Found link - Not active'
             assert page.has_no_link?('Sign agreements'), 'Found link - Sign agreements'
 
-            assert page.has_link?('Manage account'), 'No link - Manage account'
+            assert page.has_link?('My virtual machines'), 'No link - My Virtual Machines'
+            assert page.has_link?('My repositories'), 'No link - My Repositories'
+            assert page.has_link?('My current token'), 'No link - My Current Token'
+            assert page.has_link?('My SSH keys'), 'No link - My SSH Keys'
 
             if profile_config
               assert page.has_link?('Manage profile'), 'No link - Manage profile'
@@ -69,7 +72,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 +112,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 +132,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