aboutsummaryrefslogtreecommitdiffstats
path: root/bug/op_create_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'bug/op_create_test.go')
-rw-r--r--bug/op_create_test.go12
1 files changed, 8 insertions, 4 deletions
diff --git a/bug/op_create_test.go b/bug/op_create_test.go
index 2a88f256..ec53b04b 100644
--- a/bug/op_create_test.go
+++ b/bug/op_create_test.go
@@ -20,11 +20,11 @@ func TestCreate(t *testing.T) {
create.Apply(&snapshot)
- hash, err := create.Hash()
- assert.NoError(t, err)
+ id := create.Id()
+ assert.NoError(t, id.Validate())
comment := Comment{
- id: string(hash),
+ id: id,
Author: rene,
Message: "message",
UnixTime: timestamp.Timestamp(create.UnixTime),
@@ -41,7 +41,7 @@ func TestCreate(t *testing.T) {
CreatedAt: create.Time(),
Timeline: []TimelineItem{
&CreateTimelineItem{
- CommentTimelineItem: NewCommentTimelineItem(hash, comment),
+ CommentTimelineItem: NewCommentTimelineItem(id, comment),
},
},
}
@@ -61,5 +61,9 @@ func TestCreateSerialize(t *testing.T) {
err = json.Unmarshal(data, &after)
assert.NoError(t, err)
+ // enforce creating the IDs
+ before.Id()
+ rene.Id()
+
assert.Equal(t, before, &after)
}