[ARVADOS] updated: 9ec17aceb2d1361f1ae81fed5cd1d4ee1629325e

Git user git at public.curoverse.com
Tue Oct 11 16:56:38 EDT 2016


Summary of changes:
 .../test/controllers/work_units_controller_test.rb | 23 +++++++++++++++++++
 apps/workbench/test/unit/work_unit_test.rb         | 26 ----------------------
 2 files changed, 23 insertions(+), 26 deletions(-)

       via  9ec17aceb2d1361f1ae81fed5cd1d4ee1629325e (commit)
      from  a51e045712142d6bcfd0377eefa1e716925b0f68 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit 9ec17aceb2d1361f1ae81fed5cd1d4ee1629325e
Author: radhika <radhika at curoverse.com>
Date:   Tue Oct 11 16:56:05 2016 -0400

    10144: Conver the link_to_log tests into controller tests so that the #show is executed.

diff --git a/apps/workbench/test/controllers/work_units_controller_test.rb b/apps/workbench/test/controllers/work_units_controller_test.rb
index 12e0271..ee18861 100644
--- a/apps/workbench/test/controllers/work_units_controller_test.rb
+++ b/apps/workbench/test/controllers/work_units_controller_test.rb
@@ -65,4 +65,27 @@ class WorkUnitsControllerTest < ActionController::TestCase
                           }]
     get :index, encoded_params, session_for(:active)
   end
+
+  [
+    [Job, 'active', 'running_job_with_components', '/jobs/zzzzz-8i9sb-jyq01m7in1jlofj#Log'],
+    [PipelineInstance, 'active', 'pipeline_in_running_state', '/jobs/zzzzz-8i9sb-pshmckwoma9plh7#Log'],
+    [PipelineInstance, nil, 'pipeline_in_publicly_accessible_project_but_other_objects_elsewhere', 'Log unavailable'],
+  ].each do |type, token, fixture, log_link|
+    test "link_to_log for #{fixture} for #{token}" do
+      use_token 'admin'
+      obj = find_fixture(type, fixture)
+
+      @controller = if type == Job then JobsController.new else PipelineInstancesController.new end
+
+      if token
+        get :show, {id: obj['uuid']}, session_for(token)
+      else
+        Rails.configuration.anonymous_user_token =
+          api_fixture("api_client_authorizations", "anonymous", "api_token")
+        get :show, {id: obj['uuid']}
+      end
+
+      assert_includes @response.body, log_link
+    end
+  end
 end
diff --git a/apps/workbench/test/unit/work_unit_test.rb b/apps/workbench/test/unit/work_unit_test.rb
index e59d30d..0ff3814 100644
--- a/apps/workbench/test/unit/work_unit_test.rb
+++ b/apps/workbench/test/unit/work_unit_test.rb
@@ -83,32 +83,6 @@ class WorkUnitTest < ActiveSupport::TestCase
     end
   end
 
-  [
-    [Job, 'active', 'running_job_with_components', true],
-    [Job, 'active', 'queued', false],
-    [Job, nil, 'completed_job_in_publicly_accessible_project', true],
-    [Job, 'active', 'completed_job_in_publicly_accessible_project', true],
-    [PipelineInstance, 'active', 'pipeline_in_running_state', true],  # no log, but while running the log link points to pi Log tab
-    [PipelineInstance, nil, 'pipeline_in_publicly_accessible_project_but_other_objects_elsewhere', false],
-    [PipelineInstance, 'active', 'pipeline_in_publicly_accessible_project_but_other_objects_elsewhere', false], #no log for completed pi
-    [Job, nil, 'job_in_publicly_accessible_project_but_other_objects_elsewhere', false, "Log unavailable"],
-  ].each do |type, token, fixture, has_log, log_link|
-    test "link_to_log for #{fixture} for #{token}" do
-      use_token token if token
-      obj = find_fixture(type, fixture)
-      wu = obj.work_unit
-
-      link = "#{wu.uri}#Log" if has_log
-      link_to_log = wu.link_to_log
-
-      if has_log
-        assert_includes link_to_log, link
-      else
-        assert_equal log_link, link_to_log
-      end
-    end
-  end
-
   test 'can_cancel?' do
     use_token 'active' do
       assert find_fixture(Job, 'running').work_unit.can_cancel?

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list