Skip to content

Commit

Permalink
tests(plugins) ensure /plugins/schema works for all bundled plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
hishamhm committed Jan 5, 2019
1 parent 6683637 commit 44dfb85
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions spec/02-integration/04-admin_api/04-plugins_routes_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -230,14 +230,16 @@ for _, strategy in helpers.each_strategy() do

describe("/plugins/schema/{plugin}", function()
describe("GET", function()
it("returns the schema of a plugin config", function()
local res = assert(client:send {
method = "GET",
path = "/plugins/schema/request-transformer",
})
local body = assert.res_status(200, res)
local json = cjson.decode(body)
assert.is_table(json.fields)
it("returns the schema of all bundled plugins", function()
for plugin, _ in pairs(helpers.test_conf.loaded_plugins) do
local res = assert(client:send {
method = "GET",
path = "/plugins/schema/" .. plugin,
})
local body = assert.res_status(200, res)
local json = cjson.decode(body)
assert.is_table(json.fields)
end
end)
it("returns 404 on invalid plugin", function()
local res = assert(client:send {
Expand Down

0 comments on commit 44dfb85

Please sign in to comment.