Remove assertion testing for obsolete output_is_persistent field. refs #3342
[arvados.git] / services / api / test / functional / arvados / v1 / jobs_controller_test.rb
index 0d1f71f621c2b7dc6f483c8e38ab84ddc88963aa..c33b5a6af48c2eef3971d0d87e051da47bca5f9e 100644 (file)
@@ -1,9 +1,9 @@
 require 'test_helper'
-load 'test/functional/arvados/v1/git_setup.rb'
+require 'helpers/git_test_helper'
 
 class Arvados::V1::JobsControllerTest < ActionController::TestCase
 
-  include GitSetup
+  include GitTestHelper
 
   test "submit a job" do
     authorize_with :active
@@ -18,8 +18,6 @@ class Arvados::V1::JobsControllerTest < ActionController::TestCase
     new_job = JSON.parse(@response.body)
     assert_not_nil new_job['uuid']
     assert_not_nil new_job['script_version'].match(/^[0-9a-f]{40}$/)
-    # Default: not persistent
-    assert_equal false, new_job['output_is_persistent']
   end
 
   test "normalize output and log uuids when creating job" do
@@ -285,4 +283,19 @@ class Arvados::V1::JobsControllerTest < ActionController::TestCase
     assert_response :success
   end
 
+  [:active, :admin].each do |which_token|
+    test "get job queue as #{which_token} user" do
+      authorize_with which_token
+      get :queue
+      assert_response :success
+      assert_operator 1, :<=, assigns(:objects).count
+    end
+    test "get job queue as #{which_token} user, with a filter" do
+      authorize_with which_token
+      get :queue, { filters: [['script','=','foo']] }
+      assert_response :success
+      assert_equal ['foo'], assigns(:objects).collect(&:script).uniq
+    end
+  end
+
 end