Skip to content

Commit

Permalink
fix(test): fix api tests to consume refstr
Browse files Browse the repository at this point in the history
  • Loading branch information
Arqu committed Feb 16, 2021
1 parent 13438b5 commit e03ef3a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions api/api_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ func runHandlerTestCases(t *testing.T, name string, h http.HandlerFunc, cases []
if c.muxVars != nil {
req = mux.SetURLVars(req, *c.muxVars)
}
setRefStringFromMuxVars(req)
if jsonHeader {
req.Header.Set("Content-Type", "application/json")
}
Expand Down
4 changes: 3 additions & 1 deletion lib/datasets.go
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,9 @@ func (p *GetParams) UnmarshalFromRequest(r *http.Request) error {
}

params := *p
params.Refstr = r.FormValue("refstr")
if params.Refstr == "" {
params.Refstr = r.FormValue("refstr")
}

ref, err := dsref.Parse(params.Refstr)
if err != nil {
Expand Down

0 comments on commit e03ef3a

Please sign in to comment.