From 82f12a2b02e52ceac596ccbf43e968ac112d36c4 Mon Sep 17 00:00:00 2001 From: thefosk Date: Thu, 25 Feb 2016 19:03:50 -0800 Subject: [PATCH] Removes duplicate Lua table entires in tests --- spec/plugins/basic-auth/access_spec.lua | 2 +- spec/plugins/oauth2/access_spec.lua | 10 +++++----- spec/plugins/oauth2/hooks_spec.lua | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/spec/plugins/basic-auth/access_spec.lua b/spec/plugins/basic-auth/access_spec.lua index 18b9bf80d30..4872dfa7ceb 100644 --- a/spec/plugins/basic-auth/access_spec.lua +++ b/spec/plugins/basic-auth/access_spec.lua @@ -116,7 +116,7 @@ describe("Authentication Plugin", function() end) it("should pass the right headers to the upstream server", function() - local response, status = http_client.get(PROXY_URL.."/headers", {}, {host = "basicauth.com", authorization = "hello", ["authorization"] = "Basic dXNlcm5hbWU6cGFzc3dvcmQ="}) + local response, status = http_client.get(PROXY_URL.."/headers", {}, {host = "basicauth.com", ["authorization"] = "Basic dXNlcm5hbWU6cGFzc3dvcmQ="}) assert.equal(200, status) local parsed_response = cjson.decode(response) assert.truthy(parsed_response.headers["X-Consumer-Id"]) diff --git a/spec/plugins/oauth2/access_spec.lua b/spec/plugins/oauth2/access_spec.lua index f01c8a0281f..9bac8ebb71f 100644 --- a/spec/plugins/oauth2/access_spec.lua +++ b/spec/plugins/oauth2/access_spec.lua @@ -14,7 +14,7 @@ local STUB_GET_URL = spec_helper.STUB_GET_URL local STUB_POST_URL = spec_helper.STUB_POST_URL local function provision_code() - local response = http_client.post(PROXY_SSL_URL.."/oauth2/authorize", { provision_key = "provision123", authenticated_userid = "id123", client_id = "clientid123", scope = "email", response_type = "code", state = "hello", authenticated_userid = "userid123" }, {host = "oauth2.com"}) + local response = http_client.post(PROXY_SSL_URL.."/oauth2/authorize", { provision_key = "provision123", client_id = "clientid123", scope = "email", response_type = "code", state = "hello", authenticated_userid = "userid123" }, {host = "oauth2.com"}) local body = cjson.decode(response) local matches = rex.gmatch(body.redirect_uri, "^http://google\\.com/kong\\?code=([\\w]{32,32})&state=hello$") local code @@ -237,7 +237,7 @@ describe("Authentication Plugin", function() end) it("should return success and store authenticated user properties", function() - local response, status = http_client.post(PROXY_SSL_URL.."/oauth2/authorize", { provision_key = "provision123", authenticated_userid = "id123", client_id = "clientid123", scope = "email", response_type = "code", state = "hello", authenticated_userid = "userid123" }, {host = "oauth2.com"}) + local response, status = http_client.post(PROXY_SSL_URL.."/oauth2/authorize", { provision_key = "provision123", client_id = "clientid123", scope = "email", response_type = "code", state = "hello", authenticated_userid = "userid123" }, {host = "oauth2.com"}) local body = cjson.decode(response) assert.are.equal(200, status) assert.are.equal(1, utils.table_size(body)) @@ -257,7 +257,7 @@ describe("Authentication Plugin", function() end) it("should return success with a dotted scope and store authenticated user properties", function() - local response, status = http_client.post(PROXY_SSL_URL.."/oauth2/authorize", { provision_key = "provision123", authenticated_userid = "id123", client_id = "clientid123", scope = "user.email", response_type = "code", state = "hello", authenticated_userid = "userid123" }, {host = "oauth2.com"}) + local response, status = http_client.post(PROXY_SSL_URL.."/oauth2/authorize", { provision_key = "provision123", client_id = "clientid123", scope = "user.email", response_type = "code", state = "hello", authenticated_userid = "userid123" }, {host = "oauth2.com"}) local body = cjson.decode(response) assert.are.equal(200, status) assert.are.equal(1, utils.table_size(body)) @@ -301,7 +301,7 @@ describe("Authentication Plugin", function() end) it("should return success and store authenticated user properties", function() - local response, status = http_client.post(PROXY_SSL_URL.."/oauth2/authorize", { provision_key = "provision123", authenticated_userid = "id123", client_id = "clientid123", scope = "email profile", response_type = "token", authenticated_userid = "userid123" }, {host = "oauth2.com"}) + local response, status = http_client.post(PROXY_SSL_URL.."/oauth2/authorize", { provision_key = "provision123", client_id = "clientid123", scope = "email profile", response_type = "token", authenticated_userid = "userid123" }, {host = "oauth2.com"}) local body = cjson.decode(response) assert.are.equal(200, status) assert.are.equal(1, utils.table_size(body)) @@ -325,7 +325,7 @@ describe("Authentication Plugin", function() end) it("should return set the right upstream headers", function() - local response = http_client.post(PROXY_SSL_URL.."/oauth2/authorize", { provision_key = "provision123", authenticated_userid = "id123", client_id = "clientid123", scope = "email profile", response_type = "token", authenticated_userid = "userid123" }, {host = "oauth2.com"}) + local response = http_client.post(PROXY_SSL_URL.."/oauth2/authorize", { provision_key = "provision123", client_id = "clientid123", scope = "email profile", response_type = "token", authenticated_userid = "userid123" }, {host = "oauth2.com"}) local body = cjson.decode(response) local matches = rex.gmatch(body.redirect_uri, "^http://google\\.com/kong\\?access_token=([\\w]{32,32})&token_type=bearer$") diff --git a/spec/plugins/oauth2/hooks_spec.lua b/spec/plugins/oauth2/hooks_spec.lua index 72c7b6bab59..01afb0af45d 100644 --- a/spec/plugins/oauth2/hooks_spec.lua +++ b/spec/plugins/oauth2/hooks_spec.lua @@ -44,7 +44,7 @@ describe("OAuth2 Authentication Hooks", function() end) local function provision_code(client_id) - local response = http_client.post(PROXY_SSL_URL.."/oauth2/authorize", { provision_key = "provision123", authenticated_userid = "id123", client_id = client_id, scope = "email", response_type = "code", state = "hello", authenticated_userid = "userid123" }, {host = "oauth2.com"}) + local response = http_client.post(PROXY_SSL_URL.."/oauth2/authorize", { provision_key = "provision123", client_id = client_id, scope = "email", response_type = "code", state = "hello", authenticated_userid = "userid123" }, {host = "oauth2.com"}) local body = json.decode(response) if body.redirect_uri then local matches = rex.gmatch(body.redirect_uri, "^http://google\\.com/kong\\?code=([\\w]{32,32})&state=hello$")