Updated tests

This commit is contained in:
kolaente 2018-09-13 19:24:40 +02:00
parent c018589749
commit 7d8e3f1bae
No known key found for this signature in database
GPG key ID: F40E70337AB24C9B
3 changed files with 22 additions and 3 deletions

View file

@ -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

View file

@ -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

View file

@ -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))