diff options
author | Michael Muré <batolettre@gmail.com> | 2020-11-08 19:15:06 +0100 |
---|---|---|
committer | Michael Muré <batolettre@gmail.com> | 2021-02-14 12:17:44 +0100 |
commit | 7163b2283b4542a4d4abfe9a71963f122322bde7 (patch) | |
tree | 93a52a65c5ba1fd3e4112b2aa53c2c438bb5400c /bug/op_set_title_test.go | |
parent | 5ae8a132772385c903a62de2ceec02a97f108a01 (diff) | |
download | git-bug-7163b2283b4542a4d4abfe9a71963f122322bde7.tar.gz |
bug: Id from first operation data, not git + remove root link
Diffstat (limited to 'bug/op_set_title_test.go')
-rw-r--r-- | bug/op_set_title_test.go | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/bug/op_set_title_test.go b/bug/op_set_title_test.go index df27ee35..6ae325be 100644 --- a/bug/op_set_title_test.go +++ b/bug/op_set_title_test.go @@ -9,32 +9,30 @@ import ( "github.com/MichaelMure/git-bug/identity" "github.com/MichaelMure/git-bug/repository" - - "github.com/stretchr/testify/assert" ) func TestSetTitleSerialize(t *testing.T) { repo := repository.NewMockRepo() - rene := identity.NewIdentity("René Descartes", "rene@descartes.fr") - err := rene.Commit(repo) + + rene, err := identity.NewIdentity(repo, "René Descartes", "rene@descartes.fr") require.NoError(t, err) unix := time.Now().Unix() before := NewSetTitleOp(rene, unix, "title", "was") data, err := json.Marshal(before) - assert.NoError(t, err) + require.NoError(t, err) var after SetTitleOperation err = json.Unmarshal(data, &after) - assert.NoError(t, err) + require.NoError(t, err) // enforce creating the ID before.Id() // Replace the identity stub with the real thing - assert.Equal(t, rene.Id(), after.base().Author.Id()) + require.Equal(t, rene.Id(), after.base().Author.Id()) after.Author = rene - assert.Equal(t, before, &after) + require.Equal(t, before, &after) } |