Merge branch 'master' into 3661-copy-move-from-show
[arvados.git] / services / api / test / functional / arvados / v1 / collections_controller_test.rb
index 18cbafc6898bd90d49925fd17fe047fda7034793..f2c15c656b3f2570adf211cd6fdb01222cf3bfb7 100644 (file)
@@ -559,8 +559,7 @@ EOS
     "Collection should not exist in database after failed create"
   end
 
-  test 'Expired collections are not returned' do
-    permit_unsigned_manifests
+  test 'List expired collection returns empty list' do
     authorize_with :active
     get :index, {
       where: {name: 'expired_collection'},
@@ -570,8 +569,26 @@ EOS
     assert_equal 0, found.count
   end
 
-  test 'Collection with future expiration time is returned' do
-    permit_unsigned_manifests
+  test 'Show expired collection returns 404' do
+    authorize_with :active
+    get :show, {
+      id: 'zzzzz-4zz18-mto52zx1s7sn3ih',
+    }
+    assert_response 404
+  end
+
+  test 'Update expired collection returns 404' do
+    authorize_with :active
+    post :update, {
+      id: 'zzzzz-4zz18-mto52zx1s7sn3ih',
+      collection: {
+        name: "still expired"
+      }
+    }
+    assert_response 404
+  end
+
+  test 'List collection with future expiration time succeeds' do
     authorize_with :active
     get :index, {
       where: {name: 'collection_expires_in_future'},
@@ -579,4 +596,24 @@ EOS
     found = assigns(:objects)
     assert_equal 1, found.count
   end
+
+
+  test 'Show collection with future expiration time succeeds' do
+    authorize_with :active
+    get :show, {
+      id: 'zzzzz-4zz18-padkqo7yb8d9i3j',
+    }
+    assert_response :success
+  end
+
+  test 'Update collection with future expiration time succeeds' do
+    authorize_with :active
+    post :update, {
+      id: 'zzzzz-4zz18-padkqo7yb8d9i3j',
+      collection: {
+        name: "still not expired"
+      }
+    }
+    assert_response :success
+  end
 end