aboutsummaryrefslogtreecommitdiffstats
path: root/bug/bug_actions_test.go
diff options
context:
space:
mode:
authorMichael Muré <batolettre@gmail.com>2019-11-19 18:54:22 +0100
committerGitHub <noreply@github.com>2019-11-19 18:54:22 +0100
commitabae3c245e1f844ebadb79eb5d7b19412f67f886 (patch)
tree9c5e06aa4e1ef9b41ceb21408de493d2e91b3d00 /bug/bug_actions_test.go
parentfdbff4dba7d6e56edfed1030e6fede2a7a35b507 (diff)
parented2ac793e9f353720db2615b06569d05c253b977 (diff)
downloadgit-bug-abae3c245e1f844ebadb79eb5d7b19412f67f886.tar.gz
Merge pull request #257 from MichaelMure/core-fixes
Core fixes
Diffstat (limited to 'bug/bug_actions_test.go')
-rw-r--r--bug/bug_actions_test.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/bug/bug_actions_test.go b/bug/bug_actions_test.go
index 4bc58aea..38dddce2 100644
--- a/bug/bug_actions_test.go
+++ b/bug/bug_actions_test.go
@@ -4,6 +4,7 @@ import (
"testing"
"time"
+ "github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/MichaelMure/git-bug/identity"
@@ -18,8 +19,10 @@ func TestPushPull(t *testing.T) {
bug1, _, err := Create(reneA, time.Now().Unix(), "bug1", "message")
require.NoError(t, err)
+ assert.True(t, bug1.NeedCommit())
err = bug1.Commit(repoA)
require.NoError(t, err)
+ assert.False(t, bug1.NeedCommit())
// distribute the identity
_, err = identity.Push(repoA, "origin")
@@ -91,8 +94,10 @@ func _RebaseTheirs(t testing.TB) {
bug1, _, err := Create(reneA, time.Now().Unix(), "bug1", "message")
require.NoError(t, err)
+ assert.True(t, bug1.NeedCommit())
err = bug1.Commit(repoA)
require.NoError(t, err)
+ assert.False(t, bug1.NeedCommit())
// distribute the identity
_, err = identity.Push(repoA, "origin")
@@ -111,18 +116,21 @@ func _RebaseTheirs(t testing.TB) {
bug2, err := ReadLocalBug(repoB, bug1.Id())
require.NoError(t, err)
+ assert.False(t, bug2.NeedCommit())
reneB, err := identity.ReadLocal(repoA, reneA.Id())
require.NoError(t, err)
_, err = AddComment(bug2, reneB, time.Now().Unix(), "message2")
require.NoError(t, err)
+ assert.True(t, bug2.NeedCommit())
_, err = AddComment(bug2, reneB, time.Now().Unix(), "message3")
require.NoError(t, err)
_, err = AddComment(bug2, reneB, time.Now().Unix(), "message4")
require.NoError(t, err)
err = bug2.Commit(repoB)
require.NoError(t, err)
+ assert.False(t, bug2.NeedCommit())
// B --> remote
_, err = Push(repoB, "origin")