2411: Add copyright notices to everything.
[arvados.git] / apps / workbench / test / controllers / jobs_controller_test.rb
index 609e58c1c2dd72a863dd14037ce3a1eb441d30a7..f854eaa77fae4723e00bda563441c2c1a2f59e64 100644 (file)
@@ -1,4 +1,27 @@
+# Copyright (C) The Arvados Authors. All rights reserved.
+#
+# SPDX-License-Identifier: AGPL-3.0
+
 require 'test_helper'
 
 class JobsControllerTest < ActionController::TestCase
+  test "visit jobs index page" do
+    get :index, {}, session_for(:active)
+    assert_response :success
+  end
+
+  test "job page lists pipelines and jobs in which it is used" do
+    get(:show,
+        {id: api_fixture('jobs')['completed_job_in_publicly_accessible_project']['uuid']},
+        session_for(:active))
+    assert_response :success
+
+    assert_select "div.used-in-pipelines" do
+      assert_select "a[href=/pipeline_instances/zzzzz-d1hrv-n68vc490mloy4fi]"
+    end
+
+    assert_select "div.used-in-jobs" do
+      assert_select "a[href=/jobs/zzzzz-8i9sb-with2components]"
+    end
+  end
 end