From 726becee14c0f4aaa1b0f72fe33a16ee1de7ccd4 Mon Sep 17 00:00:00 2001 From: radhika Date: Tue, 22 Nov 2016 08:20:02 -0500 Subject: [PATCH] 10524: add additional test assertions to disabled_api_test --- .../app/views/projects/_show_dashboard.html.erb | 13 +++++++------ apps/workbench/app/views/projects/show.html.erb | 14 +++++++------- .../test/controllers/disabled_api_test.rb | 4 ++++ 3 files changed, 18 insertions(+), 13 deletions(-) diff --git a/apps/workbench/app/views/projects/_show_dashboard.html.erb b/apps/workbench/app/views/projects/_show_dashboard.html.erb index 478b3971f6..ab6eb16f51 100644 --- a/apps/workbench/app/views/projects/_show_dashboard.html.erb +++ b/apps/workbench/app/views/projects/_show_dashboard.html.erb @@ -25,12 +25,13 @@ %> <% - no_jobs_api = !PipelineInstance.api_exists?(:index) - recent_procs_title = 'Recent pipelines and processes' - recent_procs_title = 'Recent processes' if no_jobs_api - - run_proc_title = 'Choose a pipeline or workflow to run:' - run_proc_title = 'Choose a workflow to run:' if no_jobs_api + if !PipelineInstance.api_exists?(:index) + recent_procs_title = 'Recent processes' + run_proc_title = 'Choose a workflow to run:' + else + recent_procs_title = 'Recent pipelines and processes' + run_proc_title = 'Choose a pipeline or workflow to run:' + end %>
diff --git a/apps/workbench/app/views/projects/show.html.erb b/apps/workbench/app/views/projects/show.html.erb index 1129def7bf..5605564517 100644 --- a/apps/workbench/app/views/projects/show.html.erb +++ b/apps/workbench/app/views/projects/show.html.erb @@ -10,13 +10,13 @@ <% end %> <% - no_jobs_api = !PipelineInstance.api_exists?(:index) - - run_proc_title = 'Choose a pipeline or workflow to run:' - run_proc_title = 'Choose a workflow to run:' if no_jobs_api - - run_proc_hover = 'Run a pipeline or workflow in this project' - run_proc_hover = 'Run a workflow in this project' if no_jobs_api + if !PipelineInstance.api_exists?(:index) + run_proc_title = 'Choose a workflow to run:' + run_proc_hover = 'Run a workflow in this project' + else + run_proc_title = 'Choose a pipeline or workflow to run:' + run_proc_hover = 'Run a pipeline or workflow in this project' + end %> <% content_for :tab_line_buttons do %> diff --git a/apps/workbench/test/controllers/disabled_api_test.rb b/apps/workbench/test/controllers/disabled_api_test.rb index a41d87f31a..1154e4d5e2 100644 --- a/apps/workbench/test/controllers/disabled_api_test.rb +++ b/apps/workbench/test/controllers/disabled_api_test.rb @@ -12,6 +12,8 @@ class DisabledApiTest < ActionController::TestCase get :index, {}, session_for(:active) assert_includes @response.body, "zzzzz-xvhdp-cr4runningcntnr" # expect crs assert_not_includes @response.body, "zzzzz-d1hrv-" # expect no pipelines + assert_includes @response.body, "Run a process" + assert_not_includes @response.body, "Run a pipeline" end [ @@ -58,6 +60,8 @@ class DisabledApiTest < ActionController::TestCase assert_includes resp, "href=\"#Pipelines_and_processes\"" assert_includes resp, "href=\"#Workflows\"" assert_not_includes resp, "href=\"#Pipeline_templates\"" + assert_includes @response.body, "Run a process" + assert_not_includes @response.body, "Run a pipeline" end end end -- 2.30.2