Return 401 when getting an empty bearer token
For example: Authorization: Bearer The cause of the empty bearer also needs to be investigated
This commit is contained in:
@@ -280,7 +280,6 @@ describe "App" do
|
||||
end
|
||||
|
||||
context "not authorized" do
|
||||
|
||||
describe "with no token" do
|
||||
it "says it's not authorized" do
|
||||
delete "/phil/food/aguacate"
|
||||
@@ -290,6 +289,16 @@ describe "App" do
|
||||
end
|
||||
end
|
||||
|
||||
describe "with empty token" do
|
||||
it "says it's not authorized" do
|
||||
header "Authorization", "Bearer "
|
||||
delete "/phil/food/aguacate"
|
||||
|
||||
last_response.status.must_equal 401
|
||||
last_response.body.must_equal "Unauthorized"
|
||||
end
|
||||
end
|
||||
|
||||
describe "with wrong token" do
|
||||
it "says it's not authorized" do
|
||||
header "Authorization", "Bearer wrongtoken"
|
||||
|
||||
Reference in New Issue
Block a user