Skip to content

Commit

Permalink
Fixed gateway test failure
Browse files Browse the repository at this point in the history
  • Loading branch information
lonelycode committed Mar 16, 2015
1 parent 8af69bd commit a09ae90
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions gateway_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -424,12 +424,19 @@ func TestThrottling(t *testing.T) {

thirdRecorder := httptest.NewRecorder()
chain.ServeHTTP(thirdRecorder, req)

if thirdRecorder.Code != 200 {
t.Error("Third request failed with non-200 code: \n", thirdRecorder.Code)
}

fourthRecorder := httptest.NewRecorder()
chain.ServeHTTP(fourthRecorder, req)

if thirdRecorder.Code == 200 {
t.Error("Third request failed, should not be 200!: \n", thirdRecorder.Code)
if fourthRecorder.Code == 200 {
t.Error("Third request failed, should not be 200!: \n", fourthRecorder.Code)
}
if thirdRecorder.Code != 403 {
t.Error("Third request returned invalid code, should 403, got: \n", thirdRecorder.Code)
if fourthRecorder.Code != 403 {
t.Error("Third request returned invalid code, should 403, got: \n", fourthRecorder.Code)
}

newAPIError := TykErrorResponse{}
Expand Down

0 comments on commit a09ae90

Please sign in to comment.