X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/060d38d627bd1e51dd2b3c6e7de9af6aa7d7b6f3..a551aee4b86197ac9053b4902f8ab0bd4c92af90:/apps/workbench/test/integration/application_layout_test.rb diff --git a/apps/workbench/test/integration/application_layout_test.rb b/apps/workbench/test/integration/application_layout_test.rb index e777ebe784..51c3720985 100644 --- a/apps/workbench/test/integration/application_layout_test.rb +++ b/apps/workbench/test/integration/application_layout_test.rb @@ -3,6 +3,7 @@ # SPDX-License-Identifier: AGPL-3.0 require 'integration_helper' +require 'config_validators' class ApplicationLayoutTest < ActionDispatch::IntegrationTest # These tests don't do state-changing API calls. Save some time by @@ -56,7 +57,7 @@ class ApplicationLayoutTest < ActionDispatch::IntegrationTest assert_selector "a[href=\"/projects/#{user['uuid']}\"]", text: 'Home project' assert_selector "a[href=\"/users/#{user['uuid']}/virtual_machines\"]", text: 'Virtual machines' - assert_selector "a[href=\"/users/#{user['uuid']}/repositories\"]", text: 'Repositories' + assert_selector "a[href=\"/repositories\"]", text: 'Repositories' assert_selector "a[href=\"/current_token\"]", text: 'Current token' assert_selector "a[href=\"/users/#{user['uuid']}/ssh_keys\"]", text: 'SSH keys' @@ -140,6 +141,30 @@ class ApplicationLayoutTest < ActionDispatch::IntegrationTest end end + [ + [false, false], + ['http://wb2.example.org//', false], + ['ftp://wb2.example.org', false], + ['wb2.example.org', false], + ['http://wb2.example.org', true], + ['https://wb2.example.org', true], + ['http://wb2.example.org/', true], + ['https://wb2.example.org/', true], + ].each do |wb2_url_config, wb2_menu_appear| + test "workbench2_url=#{wb2_url_config} should#{wb2_menu_appear ? '' : ' not'} show WB2 menu" do + Rails.configuration.workbench2_url = wb2_url_config + assert_equal wb2_menu_appear, ConfigValidators::validate_wb2_url_config() + + visit page_with_token('active') + within('.navbar-fixed-top') do + page.find("#notifications-menu").click + within('.dropdown-menu') do + assert_equal wb2_menu_appear, page.has_text?('Go to Workbench 2') + end + end + end + end + [ ['active', true], ['active_with_prefs_profile_no_getting_started_shown', false], @@ -214,7 +239,7 @@ class ApplicationLayoutTest < ActionDispatch::IntegrationTest end [ - ['Repositories', nil, 's0uqq'], + ['Repositories', nil, 'active/crunchdispatchtest'], ['Virtual machines', nil, 'testvm.shell'], ['SSH keys', nil, 'public_key'], ['Links', nil, 'link_class'], @@ -260,10 +285,9 @@ class ApplicationLayoutTest < ActionDispatch::IntegrationTest end within('.recent-processes') do - assert_text 'running' within('.row-zzzzz-xvhdp-cr4runningcntnr') do - assert_text 'requester_for_running_cr' + assert_text 'running' end assert_text 'zzzzz-d1hrv-twodonepipeline'