Skip to content

Commit

Permalink
Fix BDD extraction
Browse files Browse the repository at this point in the history
  • Loading branch information
therve committed Oct 10, 2022
1 parent 1151293 commit 7ca3abd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/scenarios/step_definitions.go
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ func requestIsSent(t gobdd.StepTest, ctx gobdd.Context) {
ctx.Set(responseKey{}, result)

// Report probable serialization errors
if len(result) > 2 {
if len(result) > 1 {
resp := result[len(result)-2].Interface().(*http.Response)
if resp == nil {
return
Expand All @@ -234,7 +234,7 @@ func requestIsSent(t gobdd.StepTest, ctx gobdd.Context) {
if newErr := json.Unmarshal(err.Body(), &responseJSON); newErr != nil {
responseJSON = string(err.Body())
}
} else {
} else if len(result) == 3 {
// Store the unmarshalled JSON in context
responseJSON, err = toJSON(result[0])
if err != nil {
Expand Down

0 comments on commit 7ca3abd

Please sign in to comment.