12032: Add test fixtures
authorPeter Amstutz <peter.amstutz@curoverse.com>
Fri, 25 Aug 2017 18:23:30 +0000 (14:23 -0400)
committerPeter Amstutz <peter.amstutz@curoverse.com>
Thu, 14 Sep 2017 23:39:06 +0000 (19:39 -0400)
Arvados-DCO-1.1-Signed-off-by: Peter Amstutz <pamstutz@veritasgenetics.com>

services/api/lib/create_permission_view.sql
services/api/test/fixtures/collections.yml
services/api/test/fixtures/groups.yml

index e6195d7911f43667d885ba3f626a683da945e0f0..639610ac2a6efd53a7be2cbaf9b29a0608e805e6 100644 (file)
@@ -37,7 +37,10 @@ perm_edges (tail_uuid, head_uuid, val, follow, trashed) AS (
               LEFT JOIN groups ON pv.val<3 AND groups.uuid = links.head_uuid
               WHERE links.link_class = 'permission'
        UNION ALL
-       SELECT owner_uuid, uuid, 3, true, CASE is_trashed WHEN true THEN 1 ELSE 0 END FROM groups
+       SELECT owner_uuid, uuid, 3, true, CASE
+              WHEN trash_at IS NOT NULL and trash_at < clock_timestamp() THEN 1
+              ELSE 0 END
+              FROM groups
        ),
 perm (val, follow, user_uuid, target_uuid, trashed, startnode) AS (
      SELECT 3::smallint             AS val,
index 7777f74fa0962585d5a584bdeb9ce2684b1e42b9..802350320107b4df069ba6bea969efca50531475 100644 (file)
@@ -703,6 +703,17 @@ same_name_as_trashed_coll_to_test_name_conflict_on_untrash:
   manifest_text: ". d41d8cd98f00b204e9800998ecf8427e+0 0:0:file1 0:0:file2\n"
   name: same name for trashed and persisted collections
 
+collection_in_trashed_subproject:
+  uuid: zzzzz-4zz18-trashedproj2col
+  portable_data_hash: 80cf6dd2cf079dd13f272ec4245cb4a8+48
+  owner_uuid: zzzzz-j7d0g-trashedproject2
+  created_at: 2014-02-03T17:22:54Z
+  modified_by_client_uuid: zzzzz-ozdt8-brczlopd8u8d0jr
+  modified_by_user_uuid: zzzzz-tpzed-d9tiejq69daie8f
+  modified_at: 2014-02-03T17:22:54Z
+  updated_at: 2014-02-03T17:22:54Z
+  manifest_text: ". d41d8cd98f00b204e9800998ecf8427e+0 0:0:file1 0:0:file2\n"
+  name: collection in trashed subproject
 
 # Test Helper trims the rest of the file
 
index 90d087f534b34e600d5f665d637cf384383a7280..c9783d024dc10f23e1aa9d20373482e87d919ead 100644 (file)
@@ -298,3 +298,21 @@ starred_and_shared_active_user_project:
   name: Starred and shared active user project
   description: Starred and shared active user project
   group_class: project
+
+trashed_project:
+  uuid: zzzzz-j7d0g-trashedproject1
+  owner_uuid: zzzzz-tpzed-xurymjxw79nv3jz
+  name: trashed project
+  group_class: project
+  trash_at: 2001-01-01T00:00:00Z
+  delete_at: 2038-03-01T00:00:00Z
+  is_trashed: true
+
+trashed_subproject:
+  uuid: zzzzz-j7d0g-trashedproject2
+  owner_uuid:
+  name: trashed subproject
+  group_class: project
+  trash_at: 2001-01-01T00:00:00Z
+  delete_at: 2038-03-01T00:00:00Z
+  is_trashed: true