Added tests to read a list via namespace
continuous-integration/drone/push Build is failing Details

This commit is contained in:
konrad 2019-04-12 19:18:47 +02:00
parent 81f7e82ee7
commit 419e930087
Signed by: konrad
GPG Key ID: F40E70337AB24C9B
6 changed files with 104 additions and 13 deletions

View File

@ -106,11 +106,23 @@ func TestList(t *testing.T) {
assert.Contains(t, rec.Body.String(), `"title":"Test11"`)
})
t.Run("Shared Via Namespace-Team", func(t *testing.T) {
t.Run("Shared Via NamespaceTeam readonly", func(t *testing.T) {
rec, err := testHandler.testReadOne(nil, map[string]string{"list": "12"})
assert.NoError(t, err)
assert.Contains(t, rec.Body.String(), `"title":"Test12"`)
})
t.Run("Shared Via NamespaceTeam write", func(t *testing.T) {
rec, err := testHandler.testReadOne(nil, map[string]string{"list": "13"})
assert.NoError(t, err)
assert.Contains(t, rec.Body.String(), `"title":"Test13"`)
})
t.Run("Shared Via NamespaceTeam admin", func(t *testing.T) {
rec, err := testHandler.testReadOne(nil, map[string]string{"list": "14"})
assert.NoError(t, err)
assert.Contains(t, rec.Body.String(), `"title":"Test14"`)
})
t.Run("Shared Via Namespace-User", func(t *testing.T) {
t.Run("Shared Via NamespaceUser", func(t *testing.T) {
})
})

View File

@ -86,3 +86,27 @@
namespace_id: 6
updated: 0
created: 0
-
id: 12
title: Test12
description: Lorem Ipsum
owner_id: 6
namespace_id: 7
updated: 0
created: 0
-
id: 13
title: Test13
description: Lorem Ipsum
owner_id: 6
namespace_id: 8
updated: 0
created: 0
-
id: 14
title: Test14
description: Lorem Ipsum
owner_id: 6
namespace_id: 9
updated: 0
created: 0

View File

@ -1,28 +1,42 @@
-
id: 1
- id: 1
name: testnamespace
description: Lorem Ipsum
owner_id: 1
updated: 0
created: 0
-
id: 2
- id: 2
name: testnamespace2
description: Lorem Ipsum
owner_id: 2
updated: 0
created: 0
-
id: 3
- id: 3
name: testnamespace3
description: Lorem Ipsum
owner_id: 3
updated: 0
created: 0
-
id: 6
- id: 6
name: testnamespace6
description: Lorem Ipsum
owner_id: 6
updated: 0
created: 0
- id: 7
name: testnamespace7
description: Lorem Ipsum
owner_id: 6
updated: 0
created: 0
- id: 8
name: testnamespace8
description: Lorem Ipsum
owner_id: 6
updated: 0
created: 0
- id: 9
name: testnamespace9
description: Lorem Ipsum
owner_id: 6
updated: 0
created: 0

View File

@ -19,3 +19,15 @@
team_id: 4
user_id: 1
created: 0
-
team_id: 5
user_id: 1
created: 0
-
team_id: 6
user_id: 1
created: 0
-
team_id: 7
user_id: 1
created: 0

View File

@ -11,3 +11,24 @@
right: 0
updated: 0
created: 0
- id: 3
team_id: 5
namespace_id: 7
right: 0
updated: 0
created: 0
- id: 4
team_id: 6
namespace_id: 8
right: 1
updated: 0
created: 0
- id: 5
team_id: 7
namespace_id: 9
right: 0
updated: 0
created: 0

View File

@ -1,5 +1,4 @@
-
id: 1
- id: 1
name: testteam1
description: Lorem Ipsum
created_by_id: 1
@ -11,4 +10,13 @@
created_by_id: 1
- id: 4
name: testteam4_admin_on_list8
created_by_id: 1
- id: 5
name: testteam2_read_only_on_namespace7
created_by_id: 1
- id: 6
name: testteam3_write_on_namespace8
created_by_id: 1
- id: 7
name: testteam4_admin_on_namespace9
created_by_id: 1