From 499dbc0a032ff28eea99e5308be9b6c8f2d208ad Mon Sep 17 00:00:00 2001 From: Michael Muré Date: Wed, 1 Jul 2020 20:00:53 +0200 Subject: identity: remove support for legacy identity --- bug/op_set_status_test.go | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'bug/op_set_status_test.go') diff --git a/bug/op_set_status_test.go b/bug/op_set_status_test.go index ea032184..cdea2dd2 100644 --- a/bug/op_set_status_test.go +++ b/bug/op_set_status_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 TestSetStatusSerialize(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 := NewSetStatusOp(rene, unix, ClosedStatus) @@ -21,9 +29,12 @@ func TestSetStatusSerialize(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) } -- cgit