Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing tests #1249

Merged
merged 1 commit into from
May 25, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions kong-0.8.1-0.rockspec
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,8 @@ build = {

["kong.plugins.ip-restriction.handler"] = "kong/plugins/ip-restriction/handler.lua",
["kong.plugins.ip-restriction.schema"] = "kong/plugins/ip-restriction/schema.lua",
["kong.plugins.ip-restriction.migrations.cassandra"] = "kong/plugins/ip-restriction/migrations/cassandra.lua",
["kong.plugins.ip-restriction.migrations.postgres"] = "kong/plugins/ip-restriction/migrations/postgres.lua",

["kong.plugins.acl.migrations.cassandra"] = "kong/plugins/acl/migrations/cassandra.lua",
["kong.plugins.acl.migrations.postgres"] = "kong/plugins/acl/migrations/postgres.lua",
Expand Down
23 changes: 20 additions & 3 deletions spec/integration/05-proxy/resolver_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ local http_client = require "kong.tools.http_client"
local STUB_GET_URL = spec_helper.STUB_GET_URL
local STUB_GET_SSL_URL = spec_helper.STUB_GET_SSL_URL
local PROXY_URL = spec_helper.PROXY_URL
local API_URL = spec_helper.API_URL

-- Parses an SSL certificate returned by LuaSec
local function parse_cert(cert)
Expand Down Expand Up @@ -45,9 +46,7 @@ describe("Resolver", function()
{name = "tests-trailing-slash-path4", request_path = "/test-trailing-slash4", strip_request_path = true, upstream_url = "http://www.mockbin.org/"},
{name = "tests-deep-path", request_path = "/hello/world", strip_request_path = true, upstream_url = "http://mockbin.com"},
{name = "tests-deep-path-two", request_path = "/hello/world/wot", strip_request_path = true, upstream_url = "http://httpbin.org"},
{name = "tests-request_path-resolver2", upstream_url = "http://mockbin.com", request_path = "/headers"},
{name = "tests-root-path", upstream_url = "http://httpbin.org", request_path = "/"},
{name = "tests-root-path2", upstream_url = "http://mockbin.com", request_path = "/noroot", strip_request_path = true},
{name = "tests-request_path-resolver2", upstream_url = "http://mockbin.com", request_path = "/headers"}
},
plugin = {
{name = "key-auth", config = {key_names = {"apikey"} }, __api = 2}
Expand Down Expand Up @@ -341,6 +340,24 @@ describe("Resolver", function()
end)

describe("Priority in request_path resolutions", function()
setup(function()
spec_helper.insert_fixtures {
api = {
{name = "tests-root-path", upstream_url = "http://httpbin.org", request_path = "/"},
{name = "tests-root-path2", upstream_url = "http://mockbin.com", request_path = "/noroot", strip_request_path = true}
}
}

spec_helper.restart_kong()
end)

teardown(function()
local _, status = http_client.delete(API_URL.."/apis/tests-root-path")
assert.equal(204, status)
local _, status = http_client.delete(API_URL.."/apis/tests-root-path2")
assert.equal(204, status)
end)

it("should work for root request_path", function()
local response, status = http_client.get(PROXY_URL.."/get", {})
assert.equal(200, status)
Expand Down