diff options
Diffstat (limited to 'bug/bug_test.go')
-rw-r--r-- | bug/bug_test.go | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/bug/bug_test.go b/bug/bug_test.go index 4e8a9440..480d312e 100644 --- a/bug/bug_test.go +++ b/bug/bug_test.go @@ -73,13 +73,14 @@ func TestBugCommitLoad(t *testing.T) { bug1.Append(createOp) bug1.Append(setTitleOp) - bug1.Append(setTitleOp) - bug1.Append(addCommentOp) repo := repository.NewMockRepoForTest() + assert.True(t, bug1.NeedCommit()) + err := bug1.Commit(repo) assert.Nil(t, err) + assert.False(t, bug1.NeedCommit()) bug2, err := ReadLocalBug(repo, bug1.Id()) assert.NoError(t, err) @@ -87,11 +88,13 @@ func TestBugCommitLoad(t *testing.T) { // add more op - bug1.Append(setTitleOp) bug1.Append(addCommentOp) + assert.True(t, bug1.NeedCommit()) + err = bug1.Commit(repo) assert.Nil(t, err) + assert.False(t, bug1.NeedCommit()) bug3, err := ReadLocalBug(repo, bug1.Id()) assert.NoError(t, err) |