Check for specific error in group tests

pull/324/head
Rob Cutmore 2016-07-18 18:47:28 -04:00
parent f9a15cfe3d
commit 2d4a755c2c
1 changed files with 5 additions and 6 deletions

View File

@ -6,6 +6,7 @@ import (
"github.com/PuerkitoBio/goquery" "github.com/PuerkitoBio/goquery"
"github.com/gophish/gophish/config" "github.com/gophish/gophish/config"
"github.com/jinzhu/gorm"
"gopkg.in/check.v1" "gopkg.in/check.v1"
) )
@ -134,9 +135,8 @@ func (s *ModelsSuite) TestGetGroup(c *check.C) {
} }
func (s *ModelsSuite) TestGetGroupNoGroups(c *check.C) { func (s *ModelsSuite) TestGetGroupNoGroups(c *check.C) {
group, err := GetGroup(1, 1) _, err := GetGroup(1, 1)
c.Assert(err, check.Not(check.Equals), nil) c.Assert(err, check.Equals, gorm.ErrRecordNotFound)
c.Assert(group.Name, check.Not(check.Equals), "Test Group")
} }
func (s *ModelsSuite) TestGetGroupByName(c *check.C) { func (s *ModelsSuite) TestGetGroupByName(c *check.C) {
@ -156,9 +156,8 @@ func (s *ModelsSuite) TestGetGroupByName(c *check.C) {
} }
func (s *ModelsSuite) TestGetGroupByNameNoGroups(c *check.C) { func (s *ModelsSuite) TestGetGroupByNameNoGroups(c *check.C) {
group, err := GetGroupByName("Test Group", 1) _, err := GetGroupByName("Test Group", 1)
c.Assert(err, check.Not(check.Equals), nil) c.Assert(err, check.Equals, gorm.ErrRecordNotFound)
c.Assert(group.Name, check.Not(check.Equals), "Test Group")
} }
func (s *ModelsSuite) TestPutGroup(c *check.C) { func (s *ModelsSuite) TestPutGroup(c *check.C) {