aboutsummaryrefslogtreecommitdiffstats
path: root/bug/op_label_change_test.go
diff options
context:
space:
mode:
authorMichael Muré <batolettre@gmail.com>2020-10-04 20:57:54 +0200
committerGitHub <noreply@github.com>2020-10-04 20:57:54 +0200
commitc738852af0b8b1013c7911f2c3d275446d9e8936 (patch)
tree0ebfbc122240736292338275a5b599abaa7d710b /bug/op_label_change_test.go
parent5d1fc3ff393133a8aa67b97f9beecfe9b57c7e56 (diff)
parent499dbc0a032ff28eea99e5308be9b6c8f2d208ad (diff)
downloadgit-bug-c738852af0b8b1013c7911f2c3d275446d9e8936.tar.gz
Merge pull request #417 from MichaelMure/remove-legacy-identity
identity: remove support for legacy identity
Diffstat (limited to 'bug/op_label_change_test.go')
-rw-r--r--bug/op_label_change_test.go17
1 files changed, 14 insertions, 3 deletions
diff --git a/bug/op_label_change_test.go b/bug/op_label_change_test.go
index 2a93e362..c98b2207 100644
--- a/bug/op_label_change_test.go
+++ b/bug/op_label_change_test.go
@@ -5,12 +5,20 @@ import (
"testing"
"time"
+ "github.com/stretchr/testify/require"
+
"github.com/MichaelMure/git-bug/identity"
+ "github.com/MichaelMure/git-bug/repository"
+
"github.com/stretchr/testify/assert"
)
func TestLabelChangeSerialize(t *testing.T) {
- var rene = identity.NewBare("René Descartes", "rene@descartes.fr")
+ repo := repository.NewMockRepoForTest()
+ rene := identity.NewIdentity("René Descartes", "rene@descartes.fr")
+ err := rene.Commit(repo)
+ require.NoError(t, err)
+
unix := time.Now().Unix()
before := NewLabelChangeOperation(rene, unix, []Label{"added"}, []Label{"removed"})
@@ -21,9 +29,12 @@ func TestLabelChangeSerialize(t *testing.T) {
err = json.Unmarshal(data, &after)
assert.NoError(t, err)
- // enforce creating the IDs
+ // enforce creating the ID
before.Id()
- rene.Id()
+
+ // Replace the identity stub with the real thing
+ assert.Equal(t, rene.Id(), after.base().Author.Id())
+ after.Author = rene
assert.Equal(t, before, &after)
}