From bc678878e271348422fd2b5f5cd074b9cde90b10 Mon Sep 17 00:00:00 2001 From: Rob Cutmore Date: Fri, 15 Jul 2016 07:31:44 -0400 Subject: [PATCH] Put User tests together --- models/models_test.go | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/models/models_test.go b/models/models_test.go index 25358e60..dd6b8988 100644 --- a/models/models_test.go +++ b/models/models_test.go @@ -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") -}