diff options
author | Michael Muré <batolettre@gmail.com> | 2020-07-01 20:00:53 +0200 |
---|---|---|
committer | Michael Muré <batolettre@gmail.com> | 2020-10-04 20:50:15 +0200 |
commit | 499dbc0a032ff28eea99e5308be9b6c8f2d208ad (patch) | |
tree | 0ebfbc122240736292338275a5b599abaa7d710b /bug/op_add_comment_test.go | |
parent | 5d1fc3ff393133a8aa67b97f9beecfe9b57c7e56 (diff) | |
download | git-bug-499dbc0a032ff28eea99e5308be9b6c8f2d208ad.tar.gz |
identity: remove support for legacy identity
Diffstat (limited to 'bug/op_add_comment_test.go')
-rw-r--r-- | bug/op_add_comment_test.go | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/bug/op_add_comment_test.go b/bug/op_add_comment_test.go index 60364cf1..8bcc64e1 100644 --- a/bug/op_add_comment_test.go +++ b/bug/op_add_comment_test.go @@ -6,12 +6,18 @@ import ( "time" "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" "github.com/MichaelMure/git-bug/identity" + "github.com/MichaelMure/git-bug/repository" ) func TestAddCommentSerialize(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 := NewAddCommentOp(rene, unix, "message", nil) @@ -22,9 +28,12 @@ func TestAddCommentSerialize(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) } |