Updated tests
This commit is contained in:
parent
c018589749
commit
7d8e3f1bae
3 changed files with 22 additions and 3 deletions
|
@ -9,4 +9,10 @@
|
|||
title: Test2
|
||||
description: Lorem Ipsum
|
||||
owner_id: 3
|
||||
namespace_id: 1
|
||||
namespace_id: 1
|
||||
-
|
||||
id: 3
|
||||
title: Test3
|
||||
description: Lorem Ipsum
|
||||
owner_id: 3
|
||||
namespace_id: 2
|
|
@ -2,4 +2,9 @@
|
|||
id: 1
|
||||
name: testnamespace
|
||||
description: Lorem Ipsum
|
||||
owner_id: 1
|
||||
owner_id: 1
|
||||
-
|
||||
id: 2
|
||||
name: testnamespace2
|
||||
description: Lorem Ipsum
|
||||
owner_id: 2
|
|
@ -4,6 +4,7 @@ import (
|
|||
"github.com/stretchr/testify/assert"
|
||||
"reflect"
|
||||
"testing"
|
||||
"fmt"
|
||||
)
|
||||
|
||||
func TestTeamList(t *testing.T) {
|
||||
|
@ -61,10 +62,17 @@ func TestTeamList(t *testing.T) {
|
|||
assert.Error(t, err)
|
||||
assert.True(t, IsErrListDoesNotExist(err))
|
||||
|
||||
// Test Read all for a list where the user does not have access
|
||||
// Test Read all for a list where the user is owner of the namespace this list belongs to
|
||||
tl5 := tl
|
||||
tl5.ListID = 2
|
||||
_, err = tl5.ReadAll(&user)
|
||||
assert.NoError(t, err)
|
||||
|
||||
// Test read all for a list where the user not has access
|
||||
tl6 := tl
|
||||
tl6.ListID = 3
|
||||
_, err = tl6.ReadAll(&user)
|
||||
fmt.Println(tl6)
|
||||
assert.Error(t, err)
|
||||
assert.True(t, IsErrNeedToHaveListReadAccess(err))
|
||||
|
||||
|
|
Loading…
Reference in a new issue