mirror of
https://codeberg.org/davrot/forgejo.git
synced 2025-05-31 12:00:01 +02:00
parent
4563eb873d
commit
6b6f20b6d4
3 changed files with 16 additions and 9 deletions
|
@ -252,9 +252,16 @@ func TestGetLabelsByIssueID(t *testing.T) {
|
|||
func TestUpdateLabel(t *testing.T) {
|
||||
assert.NoError(t, PrepareTestDatabase())
|
||||
label := AssertExistsAndLoadBean(t, &Label{ID: 1}).(*Label)
|
||||
label.Color = "#ffff00"
|
||||
label.Name = "newLabelName"
|
||||
assert.NoError(t, UpdateLabel(label))
|
||||
// make sure update wont overwrite it
|
||||
update := &Label{
|
||||
ID: label.ID,
|
||||
Color: "#ffff00",
|
||||
Name: "newLabelName",
|
||||
Description: label.Description,
|
||||
}
|
||||
label.Color = update.Color
|
||||
label.Name = update.Name
|
||||
assert.NoError(t, UpdateLabel(update))
|
||||
newLabel := AssertExistsAndLoadBean(t, &Label{ID: 1}).(*Label)
|
||||
assert.Equal(t, *label, *newLabel)
|
||||
CheckConsistencyFor(t, &Label{}, &Repository{})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue