Add getShares and createShare Subsonic endpoints
This commit is contained in:
@@ -527,6 +527,47 @@ var _ = Describe("Responses", func() {
|
||||
})
|
||||
})
|
||||
|
||||
Describe("Shares", func() {
|
||||
BeforeEach(func() {
|
||||
response.Shares = &Shares{}
|
||||
})
|
||||
|
||||
Context("without data", func() {
|
||||
It("should match .XML", func() {
|
||||
Expect(xml.Marshal(response)).To(MatchSnapshot())
|
||||
})
|
||||
It("should match .JSON", func() {
|
||||
Expect(json.Marshal(response)).To(MatchSnapshot())
|
||||
})
|
||||
})
|
||||
|
||||
Context("with data", func() {
|
||||
BeforeEach(func() {
|
||||
t := time.Time{}
|
||||
share := Share{
|
||||
ID: "ABC123",
|
||||
Url: "http://localhost/p/ABC123",
|
||||
Description: "Check it out!",
|
||||
Username: "deluan",
|
||||
Created: t,
|
||||
Expires: &t,
|
||||
LastVisited: t,
|
||||
VisitCount: 2,
|
||||
}
|
||||
share.Entry = make([]Child, 2)
|
||||
share.Entry[0] = Child{Id: "1", Title: "title", Album: "album", Artist: "artist", Duration: 120}
|
||||
share.Entry[1] = Child{Id: "2", Title: "title 2", Album: "album", Artist: "artist", Duration: 300}
|
||||
response.Shares.Share = []Share{share}
|
||||
})
|
||||
It("should match .XML", func() {
|
||||
Expect(xml.Marshal(response)).To(MatchSnapshot())
|
||||
})
|
||||
It("should match .JSON", func() {
|
||||
Expect(json.Marshal(response)).To(MatchSnapshot())
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
Describe("Bookmarks", func() {
|
||||
BeforeEach(func() {
|
||||
response.Bookmarks = &Bookmarks{}
|
||||
|
||||
Reference in New Issue
Block a user