aboutsummaryrefslogtreecommitdiffstats
path: root/bug/op_add_comment_test.go
diff options
context:
space:
mode:
authorMichael Muré <batolettre@gmail.com>2022-04-19 21:47:15 +0200
committerGitHub <noreply@github.com>2022-04-19 21:47:15 +0200
commitb8a799a97d1f3b743b19a9619785497706166a50 (patch)
tree60c2cb1ea2c30fce565bfe43668218f8f17647fa /bug/op_add_comment_test.go
parent450d7f7ade2496d4ecb8ae6906f53134c96ca7fb (diff)
parentc5b70d8d94bda20fb8834782ccdb1dbdfb85b052 (diff)
downloadgit-bug-b8a799a97d1f3b743b19a9619785497706166a50.tar.gz
Merge pull request #767 from MichaelMure/single-author
bug: don't serialize multiple time the author, only once in OperationPack
Diffstat (limited to 'bug/op_add_comment_test.go')
-rw-r--r--bug/op_add_comment_test.go10
1 files changed, 4 insertions, 6 deletions
diff --git a/bug/op_add_comment_test.go b/bug/op_add_comment_test.go
index fb6fa8ed..446bdb18 100644
--- a/bug/op_add_comment_test.go
+++ b/bug/op_add_comment_test.go
@@ -5,7 +5,6 @@ import (
"testing"
"time"
- "github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/MichaelMure/git-bug/identity"
@@ -22,18 +21,17 @@ func TestAddCommentSerialize(t *testing.T) {
before := NewAddCommentOp(rene, unix, "message", nil)
data, err := json.Marshal(before)
- assert.NoError(t, err)
+ require.NoError(t, err)
var after AddCommentOperation
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.Author().Id())
+ // Replace the identity as it's not serialized
after.Author_ = rene
- assert.Equal(t, before, &after)
+ require.Equal(t, before, &after)
}