mirror of
https://github.com/juanfont/headscale.git
synced 2024-11-29 18:33:05 +00:00
fix nil in test
Signed-off-by: Kristoffer Dalby <kristoffer@tailscale.com>
This commit is contained in:
parent
281025bb16
commit
3780c9fd69
1 changed files with 3 additions and 2 deletions
|
@ -90,9 +90,10 @@ func (s *Suite) TestRenameUser(c *check.C) {
|
||||||
c.Assert(err, check.IsNil)
|
c.Assert(err, check.IsNil)
|
||||||
c.Assert(userTest2.Name, check.Equals, "test2")
|
c.Assert(userTest2.Name, check.Equals, "test2")
|
||||||
|
|
||||||
|
want := "UNIQUE constraint failed"
|
||||||
err = db.RenameUser(types.UserID(userTest2.ID), "test-renamed")
|
err = db.RenameUser(types.UserID(userTest2.ID), "test-renamed")
|
||||||
if !strings.Contains(err.Error(), "UNIQUE constraint failed") {
|
if err == nil || !strings.Contains(err.Error(), want) {
|
||||||
c.Fatalf("expected failure with unique constraint, got: %s", err.Error())
|
c.Fatalf("expected failure with unique constraint, want: %q got: %q", want, err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue