File tree Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Original file line number Diff line number Diff line change @@ -235,3 +235,35 @@ func TestUserLDAPMapping_Marshal(t *testing.T) {
235
235
236
236
testJSONMarshal (t , u , want )
237
237
}
238
+
239
+ func TestEnterprise_Marshal (t * testing.T ) {
240
+ testJSONMarshal (t , & Enterprise {}, "{}" )
241
+
242
+ u := & Enterprise {
243
+ ID : Int (1 ),
244
+ Slug : String ("s" ),
245
+ Name : String ("n" ),
246
+ NodeID : String ("nid" ),
247
+ AvatarURL : String ("au" ),
248
+ Description : String ("d" ),
249
+ WebsiteURL : String ("wu" ),
250
+ HTMLURL : String ("hu" ),
251
+ CreatedAt : & Timestamp {referenceTime },
252
+ UpdatedAt : & Timestamp {referenceTime },
253
+ }
254
+
255
+ want := `{
256
+ "id": 1,
257
+ "slug": "s",
258
+ "name": "n",
259
+ "node_id": "nid",
260
+ "avatar_url": "au",
261
+ "description": "d",
262
+ "website_url": "wu",
263
+ "html_url": "hu",
264
+ "created_at": ` + referenceTimeStr + `,
265
+ "updated_at": ` + referenceTimeStr + `
266
+ }`
267
+
268
+ testJSONMarshal (t , u , want )
269
+ }
You can’t perform that action at this time.
0 commit comments