X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/71f76a45195266c2d25a42c13b1419b000d60ffb..bf932e00f0efcce7ed6cd660f5483ffd79359c60:/apps/workbench/test/integration/user_profile_test.rb diff --git a/apps/workbench/test/integration/user_profile_test.rb b/apps/workbench/test/integration/user_profile_test.rb index 655cddf4e4..30d4943c62 100644 --- a/apps/workbench/test/integration/user_profile_test.rb +++ b/apps/workbench/test/integration/user_profile_test.rb @@ -20,11 +20,11 @@ class UserProfileTest < ActionDispatch::IntegrationTest if !user assert_text('Please log in') elsif user['is_active'] - if profile_config && !has_profile + if !profile_config.empty? && !has_profile assert_text('Save profile') add_profile user else - assert_text('Recent pipelines and processes') + assert_text('Recent processes') assert_no_text('Save profile') end elsif invited @@ -62,7 +62,7 @@ class UserProfileTest < ActionDispatch::IntegrationTest assert_selector('a', text: 'Current token') assert_selector('a', text: 'SSH keys') - if profile_config + if !profile_config.empty? assert_selector('a', text: 'Manage profile') else assert_no_selector('a', text: 'Manage profile') @@ -100,10 +100,10 @@ class UserProfileTest < ActionDispatch::IntegrationTest required_field_title = '' required_field_key = '' profile_config = Rails.configuration.Workbench.UserProfileFormFields - profile_config.each do |entry| - if entry['required'] - required_field_key = entry['key'] - required_field_title = entry['form_field_title'] + profile_config.each do |k, entry| + if entry['Required'] + required_field_key = k.to_s + required_field_title = entry['FormFieldTitle'] break end end @@ -126,7 +126,7 @@ class UserProfileTest < ActionDispatch::IntegrationTest end # profile saved and in home page now - assert_text('Recent pipelines and processes') + assert_text('Recent processes') end [ @@ -142,7 +142,7 @@ class UserProfileTest < ActionDispatch::IntegrationTest [true, false].each do |profile_required| test "visit #{token} home page when profile is #{'not ' if !profile_required}configured" do if !profile_required - Rails.configuration.Workbench.UserProfileFormFields = false + Rails.configuration.Workbench.UserProfileFormFields = [] else # Our test config enabled profile by default. So, no need to update config end