Put User tests together

pull/324/head
Rob Cutmore 2016-07-15 07:31:44 -04:00
parent e028806b5a
commit bc678878e2
1 changed files with 9 additions and 9 deletions

View File

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