11453: Merge branch 'master' into 11453-federated-tokens
[arvados.git] / services / api / test / unit / job_task_test.rb
1 # Copyright (C) The Arvados Authors. All rights reserved.
2 #
3 # SPDX-License-Identifier: AGPL-3.0
4
5 require 'test_helper'
6
7 class JobTaskTest < ActiveSupport::TestCase
8   test "new tasks get an assigned qsequence" do
9     set_user_from_auth :active
10     task = JobTask.create
11     assert_not_nil task.qsequence
12     assert_operator(task.qsequence, :>=, 0)
13   end
14
15   test "assigned qsequence is not overwritten" do
16     set_user_from_auth :active
17     task = JobTask.create!(qsequence: 99)
18     assert_equal(99, task.qsequence)
19   end
20 end