16159: Merge branch 'master' into 16159-token-expiration-on-logout
[arvados.git] / services / api / test / unit / container_test.rb
index 35e2b7ed1d0501d02162e22cd08e3556107b2799..375ab5a7bbb9d22a10144a6ae02e1b72a8f3da8c 100644 (file)
@@ -750,6 +750,17 @@ class ContainerTest < ActiveSupport::TestCase
     check_no_change_from_cancelled c
   end
 
+  test "Container locked with non-expiring token" do
+    Rails.configuration.API.TokenMaxLifetime = 1.hour
+    set_user_from_auth :active
+    c, _ = minimal_new
+    set_user_from_auth :dispatch1
+    assert c.lock, show_errors(c)
+    refute c.auth.nil?
+    assert c.auth.expires_at.nil?
+    assert c.auth.user_id == User.find_by_uuid(users(:active).uuid).id
+  end
+
   test "Container locked cancel with log" do
     set_user_from_auth :active
     c, _ = minimal_new