-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathguest_test.go
38 lines (28 loc) · 843 Bytes
/
guest_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
// Copyright (c) 2015, Sgt. Kabukiman | MIT licensed
package srapi
import (
"testing"
. "github.com/smartystreets/goconvey/convey"
)
func TestGuests(t *testing.T) {
countRequests = true
Convey("Fetching valid guest names should succeed.", t, func() {
name := "SgtRockworth"
guest, err := GuestByName(name)
So(err, ShouldBeNil)
So(guest.Name, ShouldEqual, name)
So(guest.Links, ShouldNotBeEmpty)
})
Convey("Fetching unknown guests should fail.", t, func() {
guest, err := GuestByName("i9r29fgwiurh2igtrw89fw7f")
So(err, ShouldNotBeNil)
So(guest, ShouldBeNil)
})
Convey("Each guest should have a non-empty collection of runs.", t, func() {
guest, err := GuestByName("SgtRockworth")
So(err, ShouldBeNil)
runs, err := guest.Runs(nil, nil, NoEmbeds)
So(err, ShouldBeNil)
So(runs, ShouldNotBeEmpty)
})
}