10524: add additional test assertions to disabled_api_test
authorradhika <radhika@curoverse.com>
Tue, 22 Nov 2016 13:20:02 +0000 (08:20 -0500)
committerradhika <radhika@curoverse.com>
Tue, 22 Nov 2016 13:20:02 +0000 (08:20 -0500)
apps/workbench/app/views/projects/_show_dashboard.html.erb
apps/workbench/app/views/projects/show.html.erb
apps/workbench/test/controllers/disabled_api_test.rb

index 478b3971f64ea982b3cdb43b05c22a8ab6113a36..ab6eb16f5153862061a40c6b59f85bd89819c4f5 100644 (file)
 %>
 
 <%
-  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
 %>
 
   <div class="row">
index 1129def7bf79bca0a684fb92dee00bfbcc9adb08..56055645170b8640b69c5691352ca858c45205ce 100644 (file)
 <% 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 %>
index a41d87f31ab34187804bbfb25beb12da310f9aea..1154e4d5e231beb122e84bce1c735b64bd7867ab 100644 (file)
@@ -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