forked from bsm/openrtb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
content_test.go
53 lines (46 loc) · 1.19 KB
/
content_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
package openrtb
import (
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("Content", func() {
var subject *Content
BeforeEach(func() {
Expect(fixture("content", &subject)).To(Succeed())
})
It("should parse correctly", func() {
Expect(subject).To(Equal(&Content{
ID: "1",
Title: "Video",
Producer: &Producer{
ID: "agltb3B1Yi1pbmNyDAsSA0FwcBiJkfTUCV",
Name: "yahoo",
Domain: "www.yahoo.com",
},
}))
})
})
var _ = Describe("QuotedContent", func() {
var subject *Content
BeforeEach(func() {
Expect(fixture("content.quoted", &subject)).To(Succeed())
})
It("should parse correctly", func() {
Expect(subject).To(Equal(&Content{
Keywords: "Orwell, 1984",
UserRating: "3",
Episode: 1,
Title: "This is the video title",
URL: "http://cdnp.tremormedia.com/video/1984.flv",
LiveStream: 0,
ContentRating: "G",
Length: 129,
Series: "book reading",
VideoQuality: 2,
Context: 1,
Season: "1",
SourceRelationship: 0,
ID: "eb9f13ede5fd225333971523f6042f9d",
}))
})
})