9799: Move work unit tests from application_layout_test to work_units_test.
authorTom Clegg <tom@curoverse.com>
Tue, 30 Aug 2016 20:23:59 +0000 (16:23 -0400)
committerTom Clegg <tom@curoverse.com>
Wed, 31 Aug 2016 02:05:33 +0000 (22:05 -0400)
apps/workbench/test/integration/application_layout_test.rb
apps/workbench/test/integration/work_units_test.rb

index 81ddda6c2160b919d2faea833ef7c915e9d912c3..93827a9c74339a2b67365e6199ad9e2d32668410 100644 (file)
@@ -286,76 +286,4 @@ class ApplicationLayoutTest < ActionDispatch::IntegrationTest
       end
     end
   end
-
-  [
-    ['jobs', 'running_job_with_components', true],
-    ['pipeline_instances', 'components_is_jobspec', false],
-    ['containers', 'running', false],
-    ['container_requests', 'running', true],
-  ].each do |type, fixture, cancelable|
-    test "cancel button for #{type}/#{fixture}" do
-      if cancelable
-        need_selenium 'to cancel'
-      end
-
-      obj = api_fixture(type)[fixture]
-      visit page_with_token "active", "/#{type}/#{obj['uuid']}"
-
-      assert_text 'created_at'
-      if cancelable
-        assert_selector 'button', text: 'Cancel'
-        click_button 'Cancel'
-        wait_for_ajax
-      end
-      assert_no_selector 'button', text: 'Cancel'
-    end
-  end
-
-  [
-    ['jobs', 'running_job_with_components'],
-    ['pipeline_instances', 'has_component_with_completed_jobs'],
-    ['container_requests', 'running'],
-    ['container_requests', 'completed'],
-  ].each do |type, fixture|
-    test "edit description for #{type}/#{fixture}" do
-      obj = api_fixture(type)[fixture]
-      visit page_with_token "active", "/#{type}/#{obj['uuid']}"
-
-      within('.arv-description-as-subtitle') do
-        find('.fa-pencil').click
-        find('.editable-input textarea').set('*Textile description for object*')
-        find('.editable-submit').click
-      end
-      wait_for_ajax
-
-      # verify description
-      assert page.has_no_text? '*Textile description for object*'
-      assert page.has_text? 'Textile description for object'
-    end
-  end
-
-  [
-    ['Two Part Pipeline Template', 'part-one', 'Provide a value for the following'],
-    ['Workflow with input specifications', 'this workflow has inputs specified', 'Provide a value for the following'],
-  ].each do |template_name, preview_txt, process_txt|
-    test "run a process using template #{template_name} from dashboard" do
-      visit page_with_token('admin')
-      assert_text 'Recent pipelines and processes' # seeing dashboard now
-
-      within('.recent-processes-actions') do
-        assert page.has_link?('All processes')
-        find('a', text: 'Run a pipeline').click
-      end
-
-      # in the chooser, verify preview and click Next button
-      within('.modal-dialog') do
-        find('.selectable', text: template_name).click
-        assert_text preview_txt
-        find('.btn', text: 'Next: choose inputs').click
-      end
-
-      # in the process page now
-      assert_text process_txt
-    end
-  end
 end
index 63ba275e6bdebf8f69d7d182da2a58fed531f662..f842d12d2585de9708ab23ab84ef3ed7bb68754d 100644 (file)
@@ -55,4 +55,76 @@ class WorkUnitsTest < ActionDispatch::IntegrationTest
         assert_no_selector "a[href=\"#{link}\"]"
       end
   end
+
+  [
+    ['jobs', 'running_job_with_components', true],
+    ['pipeline_instances', 'components_is_jobspec', false],
+    ['containers', 'running', false],
+    ['container_requests', 'running', true],
+  ].each do |type, fixture, cancelable|
+    test "cancel button for #{type}/#{fixture}" do
+      if cancelable
+        need_selenium 'to cancel'
+      end
+
+      obj = api_fixture(type)[fixture]
+      visit page_with_token "active", "/#{type}/#{obj['uuid']}"
+
+      assert_text 'created_at'
+      if cancelable
+        assert_selector 'button', text: 'Cancel'
+        click_button 'Cancel'
+        wait_for_ajax
+      end
+      assert_no_selector 'button', text: 'Cancel'
+    end
+  end
+
+  [
+    ['jobs', 'running_job_with_components'],
+    ['pipeline_instances', 'has_component_with_completed_jobs'],
+    ['container_requests', 'running'],
+    ['container_requests', 'completed'],
+  ].each do |type, fixture|
+    test "edit description for #{type}/#{fixture}" do
+      obj = api_fixture(type)[fixture]
+      visit page_with_token "active", "/#{type}/#{obj['uuid']}"
+
+      within('.arv-description-as-subtitle') do
+        find('.fa-pencil').click
+        find('.editable-input textarea').set('*Textile description for object*')
+        find('.editable-submit').click
+      end
+      wait_for_ajax
+
+      # verify description
+      assert page.has_no_text? '*Textile description for object*'
+      assert page.has_text? 'Textile description for object'
+    end
+  end
+
+  [
+    ['Two Part Pipeline Template', 'part-one', 'Provide a value for the following'],
+    ['Workflow with input specifications', 'this workflow has inputs specified', 'Provide a value for the following'],
+  ].each do |template_name, preview_txt, process_txt|
+    test "run a process using template #{template_name} from dashboard" do
+      visit page_with_token('admin')
+      assert_text 'Recent pipelines and processes' # seeing dashboard now
+
+      within('.recent-processes-actions') do
+        assert page.has_link?('All processes')
+        find('a', text: 'Run a pipeline').click
+      end
+
+      # in the chooser, verify preview and click Next button
+      within('.modal-dialog') do
+        find('.selectable', text: template_name).click
+        assert_text preview_txt
+        find('.btn', text: 'Next: choose inputs').click
+      end
+
+      # in the process page now
+      assert_text process_txt
+    end
+  end
 end