Skip to content

Commit

Permalink
Add assertion for 1st api request before pagination
Browse files Browse the repository at this point in the history
  • Loading branch information
mislav committed Jun 16, 2020
1 parent 7907def commit 3f940c9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pkg/cmd/api/api_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,8 @@ func Test_apiRun_pagination(t *testing.T) {
return &http.Client{Transport: tr}, nil
},

Paginate: true,
RequestPath: "issues",
Paginate: true,
}

err := apiRun(&options)
Expand All @@ -340,6 +341,7 @@ func Test_apiRun_pagination(t *testing.T) {
assert.Equal(t, `{"page":1}{"page":2}{"page":3}`, stdout.String(), "stdout")
assert.Equal(t, "", stderr.String(), "stderr")

assert.Equal(t, "https://api.github.com/issues", responses[0].Request.URL.String())
assert.Equal(t, "https://api.github.com/repositories/1227/issues?page=2", responses[1].Request.URL.String())
assert.Equal(t, "https://api.github.com/repositories/1227/issues?page=3", responses[2].Request.URL.String())
}
Expand Down

0 comments on commit 3f940c9

Please sign in to comment.