+# Copyright (C) The Arvados Authors. All rights reserved.
+#
+# SPDX-License-Identifier: AGPL-3.0
+
require 'test_helper'
class ContainerTest < ActiveSupport::TestCase
check_no_change_from_cancelled c
end
+ test "Container queued count" do
+ assert_equal 1, Container.readable_by(users(:active)).where(state: "Queued").count
+ end
+
test "Container locked cancel" do
c, _ = minimal_new
set_user_from_auth :dispatch1
check_no_change_from_cancelled c
end
+ test "Container locked cancel with log" do
+ c, _ = minimal_new
+ set_user_from_auth :dispatch1
+ assert c.lock, show_errors(c)
+ assert c.update_attributes(
+ state: Container::Cancelled,
+ log: collections(:real_log_collection).portable_data_hash,
+ ), show_errors(c)
+ check_no_change_from_cancelled c
+ end
+
test "Container running cancel" do
c, _ = minimal_new
set_user_from_auth :dispatch1