File tree 2 files changed +9
-2
lines changed
2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change 1
1
package controllers
2
2
3
3
import (
4
+ "strconv"
5
+
4
6
"github.com/BrandonRomano/wrecker"
5
7
"github.com/carrot/go-pinterest/models"
6
8
)
@@ -22,6 +24,7 @@ func newMeFollowingUsersController(wc *wrecker.Wrecker) *MeFollowingUsersControl
22
24
// parameters for the Fetch method
23
25
type FollowingUsersControllerFetchOptionals struct {
24
26
Cursor string
27
+ Limit int
25
28
}
26
29
27
30
// Fetch loads the users that the authorized user follows
@@ -36,6 +39,9 @@ func (c *MeFollowingUsersController) Fetch(optionals *FollowingUsersControllerFe
36
39
if optionals .Cursor != "" {
37
40
request .URLParam ("cursor" , optionals .Cursor )
38
41
}
42
+ if optionals .Limit != 0 {
43
+ request .URLParam ("limit" , strconv .Itoa (optionals .Limit ))
44
+ }
39
45
httpResp , err := request .Execute ()
40
46
41
47
// Check Error
Original file line number Diff line number Diff line change @@ -1083,13 +1083,14 @@ func (suite *ClientTestSuite) TestSuccessfulMeFollowingUsersFetch() {
1083
1083
assert .Equal (suite .T (), len (* users ), 25 )
1084
1084
1085
1085
// Load second page
1086
- suite .client .Me .Following .Users .Fetch (
1086
+ users , _ , err = suite .client .Me .Following .Users .Fetch (
1087
1087
& controllers.FollowingUsersControllerFetchOptionals {
1088
1088
Cursor : page .Cursor ,
1089
+ Limit : 3 ,
1089
1090
},
1090
1091
)
1091
1092
assert .Equal (suite .T (), nil , err )
1092
- assert .True (suite .T (), len (* users ) > 0 )
1093
+ assert .True (suite .T (), len (* users ) == 3 )
1093
1094
}
1094
1095
1095
1096
// TestTimeoutMeFollowingUsersFetch tests that an error is appropriately thrown
You can’t perform that action at this time.
0 commit comments