Updated tests
This commit is contained in:
parent
c018589749
commit
7d8e3f1bae
3 changed files with 22 additions and 3 deletions
|
@ -10,3 +10,9 @@
|
||||||
description: Lorem Ipsum
|
description: Lorem Ipsum
|
||||||
owner_id: 3
|
owner_id: 3
|
||||||
namespace_id: 1
|
namespace_id: 1
|
||||||
|
-
|
||||||
|
id: 3
|
||||||
|
title: Test3
|
||||||
|
description: Lorem Ipsum
|
||||||
|
owner_id: 3
|
||||||
|
namespace_id: 2
|
|
@ -3,3 +3,8 @@
|
||||||
name: testnamespace
|
name: testnamespace
|
||||||
description: Lorem Ipsum
|
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"
|
"github.com/stretchr/testify/assert"
|
||||||
"reflect"
|
"reflect"
|
||||||
"testing"
|
"testing"
|
||||||
|
"fmt"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestTeamList(t *testing.T) {
|
func TestTeamList(t *testing.T) {
|
||||||
|
@ -61,10 +62,17 @@ func TestTeamList(t *testing.T) {
|
||||||
assert.Error(t, err)
|
assert.Error(t, err)
|
||||||
assert.True(t, IsErrListDoesNotExist(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 := tl
|
||||||
tl5.ListID = 2
|
tl5.ListID = 2
|
||||||
_, err = tl5.ReadAll(&user)
|
_, 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.Error(t, err)
|
||||||
assert.True(t, IsErrNeedToHaveListReadAccess(err))
|
assert.True(t, IsErrNeedToHaveListReadAccess(err))
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue