Browse Source

Forgot a test for tag, added it

master
Gisle Aune 7 years ago
parent
commit
b48c22c84d
  1. 30
      model/tag_test.go

30
model/tag_test.go

@ -115,6 +115,36 @@ func TestTag(t *testing.T) {
testTag = tag
})
t.Run("Update", func(t *testing.T) {
if testTag == nil {
t.Error("No tag to modify")
t.Fail()
return
}
testTag.Type = "Character"
testTag.Name = "Urdnot Sild"
err := testTag.Update()
if err != nil {
t.Error("Modify failed:", err)
t.Fail()
}
tag, err := FindTag("name", name)
if err != nil && err.Error() != "not found" {
t.Log("Failed to get tags:", err)
t.Fail()
}
if tag != nil {
t.Log("Tag found by old name")
t.Fail()
return
}
name = testTag.Name
})
t.Run("FindByName", func(t *testing.T) {
tag, err := FindTag("name", name)
if err != nil {

Loading…
Cancel
Save