Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
shenal committed Jun 22, 2020
1 parent 5633a07 commit 3ac6b75
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions t/admin/routes.t
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ __DATA__
location /t {
content_by_lua_block {
local t = require("lib.test_admin").test
local code, body = t('/apisix/admin/routes/1',
local code, body, res = t('/apisix/admin/routes/1',
ngx.HTTP_PUT,
[[{
"methods": ["GET"],
Expand Down Expand Up @@ -64,7 +64,7 @@ __DATA__
"action": "set"
}]]
)

ngx.header["Content Type"] = res.header["Content Type"]
ngx.status = code
ngx.say(body)
}
Expand Down Expand Up @@ -211,7 +211,7 @@ GET /t
ngx.say(message)
return
end

ngx.header["Content Type"] = res.header["Content Type"]
ngx.say("[push] code: ", code, " message: ", message)

local id = string.sub(res.node.key, #"/apisix/routes/" + 1)
Expand Down Expand Up @@ -270,6 +270,7 @@ Content-Type: application/json
}]]
)

ngx.header["Content Type"] = res.header["Content Type"]
if code ~= 200 then
ngx.status = code
ngx.say(message)
Expand Down Expand Up @@ -327,6 +328,7 @@ Content-Type: application/json
}]]
)

ngx.header["Content Type"] = res.header["Content Type"]
if code ~= 200 then
ngx.status = code
ngx.say(message)
Expand Down

0 comments on commit 3ac6b75

Please sign in to comment.