mirror of https://github.com/gophish/gophish
Add more tests for getting group(s)
parent
3a9bc91415
commit
f9a15cfe3d
|
@ -111,6 +111,12 @@ func (s *ModelsSuite) TestGetGroups(c *check.C) {
|
|||
c.Assert(groups[1].Targets[0].Email, check.Equals, "test2@example.com")
|
||||
}
|
||||
|
||||
func (s *ModelsSuite) TestGetGroupsNoGroups(c *check.C) {
|
||||
groups, err := GetGroups(1)
|
||||
c.Assert(err, check.Equals, nil)
|
||||
c.Assert(len(groups), check.Equals, 0)
|
||||
}
|
||||
|
||||
func (s *ModelsSuite) TestGetGroup(c *check.C) {
|
||||
// Add group.
|
||||
PostGroup(&Group{
|
||||
|
@ -127,6 +133,12 @@ func (s *ModelsSuite) TestGetGroup(c *check.C) {
|
|||
c.Assert(group.Targets[0].Email, check.Equals, "test@example.com")
|
||||
}
|
||||
|
||||
func (s *ModelsSuite) TestGetGroupNoGroups(c *check.C) {
|
||||
group, err := GetGroup(1, 1)
|
||||
c.Assert(err, check.Not(check.Equals), nil)
|
||||
c.Assert(group.Name, check.Not(check.Equals), "Test Group")
|
||||
}
|
||||
|
||||
func (s *ModelsSuite) TestGetGroupByName(c *check.C) {
|
||||
// Add group.
|
||||
PostGroup(&Group{
|
||||
|
@ -143,6 +155,12 @@ func (s *ModelsSuite) TestGetGroupByName(c *check.C) {
|
|||
c.Assert(group.Targets[0].Email, check.Equals, "test@example.com")
|
||||
}
|
||||
|
||||
func (s *ModelsSuite) TestGetGroupByNameNoGroups(c *check.C) {
|
||||
group, err := GetGroupByName("Test Group", 1)
|
||||
c.Assert(err, check.Not(check.Equals), nil)
|
||||
c.Assert(group.Name, check.Not(check.Equals), "Test Group")
|
||||
}
|
||||
|
||||
func (s *ModelsSuite) TestPutGroup(c *check.C) {
|
||||
// Add test group.
|
||||
group := Group{Name: "Test Group"}
|
||||
|
|
Loading…
Reference in New Issue