mirror of https://github.com/gophish/gophish
Put User tests together
parent
e028806b5a
commit
bc678878e2
|
@ -45,6 +45,15 @@ func (s *ModelsSuite) TestGetUser(c *check.C) {
|
|||
c.Assert(u.Username, check.Equals, "admin")
|
||||
}
|
||||
|
||||
func (s *ModelsSuite) TestPutUser(c *check.C) {
|
||||
u, err := GetUser(1)
|
||||
u.Username = "admin_changed"
|
||||
err = PutUser(&u)
|
||||
c.Assert(err, check.Equals, nil)
|
||||
u, err = GetUser(1)
|
||||
c.Assert(u.Username, check.Equals, "admin_changed")
|
||||
}
|
||||
|
||||
func (s *ModelsSuite) TestGeneratedAPIKey(c *check.C) {
|
||||
u, err := GetUser(1)
|
||||
c.Assert(err, check.Equals, nil)
|
||||
|
@ -237,12 +246,3 @@ func (s *ModelsSuite) TestPostPage(c *check.C) {
|
|||
c.Assert(ok, check.Equals, false)
|
||||
})
|
||||
}
|
||||
|
||||
func (s *ModelsSuite) TestPutUser(c *check.C) {
|
||||
u, err := GetUser(1)
|
||||
u.Username = "admin_changed"
|
||||
err = PutUser(&u)
|
||||
c.Assert(err, check.Equals, nil)
|
||||
u, err = GetUser(1)
|
||||
c.Assert(u.Username, check.Equals, "admin_changed")
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue