Skip to content

Commit

Permalink
Fixing test
Browse files Browse the repository at this point in the history
Former-commit-id: 854e276ac7a90897abb5d91f92de411b3095caab
  • Loading branch information
subnetmarco committed Jun 29, 2015
1 parent 2cdc619 commit 86c626b
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions spec/plugins/keyauth/api_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,9 @@ describe("Key Auth Credentials API", function()
assert.equal(consumer.id, credential.consumer_id)
end)

it("[FAILURE] should return proper errors", function()
it("[SUCCESS] should create a keyauth credential auto-generating the key", function()
local response, status = http_client.post(BASE_URL, {})
assert.equal(400, status)
assert.equal('{"key":"key is required"}\n', response)
assert.equal(201, status)
end)

end)
Expand All @@ -53,10 +52,9 @@ describe("Key Auth Credentials API", function()
assert.equal(consumer.id, credential.consumer_id)
end)

it("[FAILURE] should return proper errors", function()
it("[SUCCESS] should create a keyauth credential auto-generating the key", function()
local response, status = http_client.put(BASE_URL, {})
assert.equal(400, status)
assert.equal('{"key":"key is required"}\n', response)
assert.equal(201, status)
end)

end)
Expand All @@ -67,7 +65,7 @@ describe("Key Auth Credentials API", function()
local response, status = http_client.get(BASE_URL)
assert.equal(200, status)
local body = json.decode(response)
assert.equal(1, #(body.data))
assert.equal(3, #(body.data))
end)

end)
Expand Down

0 comments on commit 86c626b

Please sign in to comment.