Skip to content

Commit fd328b9

Browse files
committed
Add test for quoted context field in Content object
1 parent cb99031 commit fd328b9

File tree

2 files changed

+45
-0
lines changed

2 files changed

+45
-0
lines changed

content_test.go

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,32 @@ var _ = Describe("Content", func() {
2626
})
2727

2828
})
29+
30+
var _ = Describe("QuotedContent", func() {
31+
var subject *Content
32+
33+
BeforeEach(func() {
34+
err := fixture("content.quoted", &subject)
35+
Expect(err).NotTo(HaveOccurred())
36+
})
37+
38+
It("should parse correctly", func() {
39+
Expect(subject).To(Equal(&Content{
40+
Keywords: "Orwell, 1984",
41+
UserRating: "3",
42+
Episode: 1,
43+
Title: "This is the video title",
44+
URL: "http://cdnp.tremormedia.com/video/1984.flv",
45+
LiveStream: 0,
46+
ContentRating: "G",
47+
Len: 129,
48+
Series: "book reading",
49+
VideoQuality: 2,
50+
Context: 1,
51+
Season: "1",
52+
SourceRelationship: 0,
53+
ID: "eb9f13ede5fd225333971523f6042f9d",
54+
}))
55+
})
56+
57+
})

testdata/content.quoted.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"keywords": "Orwell, 1984",
3+
"userrating": "3",
4+
"episode": 1,
5+
"title": "This is the video title",
6+
"url": "http://cdnp.tremormedia.com/video/1984.flv",
7+
"livestream": 0,
8+
"contentrating": "G",
9+
"len": 129,
10+
"series": "book reading",
11+
"videoquality": 2,
12+
"context": "1",
13+
"season": "1",
14+
"sourcerelationship": 0,
15+
"id": "eb9f13ede5fd225333971523f6042f9d"
16+
}

0 commit comments

Comments
 (0)