Added lists and integration tests for team sharing
continuous-integration/drone/push Build is failing Details

This commit is contained in:
kolaente 2019-04-12 15:43:00 +02:00
parent 8672a47076
commit 2b4cba71a9
Signed by: konrad
GPG Key ID: F40E70337AB24C9B
7 changed files with 105 additions and 6 deletions

View File

@ -72,13 +72,27 @@ func TestList(t *testing.T) {
assert.Error(t, err)
assert.Contains(t, err.(*echo.HTTPError).Message, `You don't have the right to see this`)
})
t.Run("Shared Via Team", func(t *testing.T) {
// TODO: Each of these rights checks should also be checked for each right
// since everyone who has a right should be able to see the list, regardless of their right
t.Run("Shared Via Team readonly", func(t *testing.T) {
rec, err := testHandler.testReadOne(nil, map[string]string{"list": "6"})
assert.NoError(t, err)
assert.Contains(t, rec.Body.String(), `"title":"Test6"`)
})
t.Run("Shared Via Team write", func(t *testing.T) {
rec, err := testHandler.testReadOne(nil, map[string]string{"list": "7"})
assert.NoError(t, err)
assert.Contains(t, rec.Body.String(), `"title":"Test7"`)
})
t.Run("Shared Via Team admin", func(t *testing.T) {
rec, err := testHandler.testReadOne(nil, map[string]string{"list": "8"})
assert.NoError(t, err)
assert.Contains(t, rec.Body.String(), `"title":"Test8"`)
})
t.Run("Shared Via User", func(t *testing.T) {
rec, err := testHandler.testReadOne(nil, map[string]string{"list": "3"})
assert.NoError(t, err)
assert.Contains(t, rec.Body.String(), `"title":"Test3"`)
})
t.Run("Shared Via User", func(t *testing.T) {
})
t.Run("Shared Via Namespace-Team", func(t *testing.T) {

View File

@ -38,3 +38,35 @@
namespace_id: 5
updated: 0
created: 0
-
id: 6
title: Test6
description: Lorem Ipsum
owner_id: 6
namespace_id: 6
updated: 0
created: 0
-
id: 7
title: Test7
description: Lorem Ipsum
owner_id: 6
namespace_id: 6
updated: 0
created: 0
-
id: 8
title: Test8
description: Lorem Ipsum
owner_id: 6
namespace_id: 6
updated: 0
created: 0
-
id: 9
title: Test9
description: Lorem Ipsum
owner_id: 6
namespace_id: 6
updated: 0
created: 0

View File

@ -19,3 +19,10 @@
owner_id: 3
updated: 0
created: 0
-
id: 6
name: testnamespace6
description: Lorem Ipsum
owner_id: 6
updated: 0
created: 0

View File

@ -5,9 +5,26 @@
updated: 0
created: 0
# This team has read only access on list 6
- id: 2
team_id: 2
list_id: 3
list_id: 6
right: 0
updated: 0
created: 0
# This team has write access on list 7
- id: 3
team_id: 3
list_id: 7
right: 1
updated: 0
created: 0
# This team has admin access on list 8
- id: 4
team_id: 4
list_id: 8
right: 0
updated: 0
created: 0

View File

@ -7,3 +7,15 @@
team_id: 1
user_id: 2
created: 0
-
team_id: 2
user_id: 1
created: 0
-
team_id: 3
user_id: 1
created: 0
-
team_id: 4
user_id: 1
created: 0

View File

@ -2,4 +2,13 @@
id: 1
name: testteam1
description: Lorem Ipsum
created_by_id: 1
- id: 2
name: testteam2_read_only_on_list6
created_by_id: 1
- id: 3
name: testteam3_write_on_list7
created_by_id: 1
- id: 4
name: testteam4_admin_on_list8
created_by_id: 1

View File

@ -33,8 +33,16 @@
id: 5
username: 'user5'
password: '$2a$14$dcadBoMBL9jQoOcZK8Fju.cy0Ptx2oZECkKLnaa8ekRoTFe1w7To.' # 1234
email: 'user4@example.com'
email: 'user5@example.com'
email_confirm_token: tiepiQueed8ahc7zeeFe1eveiy4Ein8osooxegiephauph2Ael
is_active: false
updated: 0
created: 0
# This use is used to create a whole bunch of lists which are then shared directly with a user
- id: 6
username: 'user6'
password: '$2a$14$dcadBoMBL9jQoOcZK8Fju.cy0Ptx2oZECkKLnaa8ekRoTFe1w7To.' # 1234
email: 'user6@example.com'
is_active: true
updated: 0
created: 0