Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
StarlightIbuki committed Jul 7, 2022
1 parent 42eac6b commit 59453b8
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion spec/01-unit/01-db/01-schema/05-services_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ describe("services", function()

local ok, err = Services:validate(service)
assert.falsy(ok)
assert.equal("should start with: /", err.path)
assert.equal("should start with: / (fixed path) or ~/ (regex path)", err.path)
end)

it("must not have empty segments (/foo//bar)", function()
Expand Down
2 changes: 1 addition & 1 deletion spec/01-unit/01-db/01-schema/06-routes_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ describe("routes schema", function()

local ok, err = Routes:validate(route)
assert.falsy(ok)
assert.equal("should start with: /", err.paths[1])
assert.equal("should start with: / (fixed path) or ~/ (regex path)", err.paths[1])
end)

it("must not have empty segments (/foo//bar)", function()
Expand Down
2 changes: 1 addition & 1 deletion spec/01-unit/01-db/01-schema/09-upstreams_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ describe("load upstreams", function()
{{ active = { concurrency = 0 }}, pos_integer },
{{ active = { concurrency = -10 }}, pos_integer },
{{ active = { http_path = "" }}, len_min_default },
{{ active = { http_path = "ovo" }}, "should start with: /" },
{{ active = { http_path = "ovo" }}, "should start with: / (fixed path) or ~/ (regex path)" },
{{ active = { https_sni = "127.0.0.1", }}, invalid_ip },
{{ active = { https_sni = "127.0.0.1:8080", }}, invalid_ip },
{{ active = { https_sni = "/example", }}, invalid_host },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,7 @@ describe("declarative config: validate", function()
["routes"] = {
{
["paths"] = {
"should start with: /"
"should start with: / (fixed path) or ~/ (regex path)"
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions spec/02-integration/04-admin_api/07-upstreams_routes_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@ describe("Admin API: #" .. strategy, function()
})
body = assert.res_status(400, res)
local json = cjson.decode(body)
assert.same({ hash_on_cookie_path = "should start with: /" }, json.fields)
assert.same({ hash_on_cookie_path = "should start with: / (fixed path) or ~/ (regex path)" }, json.fields)

-- Invalid cookie in hash fallback
res = assert(client:send {
Expand Down Expand Up @@ -455,7 +455,7 @@ describe("Admin API: #" .. strategy, function()
})
body = assert.res_status(400, res)
local json = cjson.decode(body)
assert.same({ hash_on_cookie_path = "should start with: /" }, json.fields)
assert.same({ hash_on_cookie_path = "should start with: / (fixed path) or ~/ (regex path)" }, json.fields)

end
end)
Expand Down
4 changes: 2 additions & 2 deletions spec/02-integration/04-admin_api/10-services_routes_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -843,11 +843,11 @@ for _, strategy in helpers.each_strategy() do
message = unindent([[
2 schema violations
(host: required field missing;
path: should start with: /)
path: should start with: / (fixed path) or ~/ (regex path))
]], true, true),
fields = {
host = "required field missing",
path = "should start with: /",
path = "should start with: / (fixed path) or ~/ (regex path)",
},
}, json
)
Expand Down

0 comments on commit 59453b8

Please sign in to comment.