This commit is contained in:
Sdogruyol 2016-07-17 14:31:45 +03:00
parent 6ffa4af0e1
commit 4edebcf8eb
6 changed files with 12 additions and 13 deletions

View file

@ -54,7 +54,7 @@ describe "Context" do
key: env.get("key"), key: env.get("key"),
before_get: env.get("before_get"), before_get: env.get("before_get"),
before_get_int: env.get("before_get_int"), before_get_int: env.get("before_get_int"),
before_get_float: env.get("before_get_float") before_get_float: env.get("before_get_float"),
} }
end end
request = HTTP::Request.new("GET", "/") request = HTTP::Request.new("GET", "/")

View file

@ -74,7 +74,7 @@ describe "Macros" do
env.response.headers.add "Content-Type", "image/png" env.response.headers.add "Content-Type", "image/png"
headers env, { headers env, {
"Access-Control-Allow-Origin" => "*", "Access-Control-Allow-Origin" => "*",
"Content-Type" => "text/plain" "Content-Type" => "text/plain",
} }
end end

View file

@ -1,7 +1,6 @@
require "../spec_helper" require "../spec_helper"
describe "Kemal::Middleware::CSRF" do describe "Kemal::Middleware::CSRF" do
it "sends GETs to next handler" do it "sends GETs to next handler" do
handler = Kemal::Middleware::CSRF.new handler = Kemal::Middleware::CSRF.new
request = HTTP::Request.new("GET", "/") request = HTTP::Request.new("GET", "/")
@ -55,7 +54,7 @@ describe "Kemal::Middleware::CSRF" do
body: "hasan=lamec", body: "hasan=lamec",
headers: HTTP::Headers{"Content-Type" => "application/x-www-form-urlencoded", headers: HTTP::Headers{"Content-Type" => "application/x-www-form-urlencoded",
"Set-Cookie" => client_response.headers["Set-Cookie"], "Set-Cookie" => client_response.headers["Set-Cookie"],
"x-csrf-token" => current_token }) "x-csrf-token" => current_token})
io, context = process_request(handler, request) io, context = process_request(handler, request)
client_response = HTTP::Client::Response.from_io(io, decompress: false) client_response = HTTP::Client::Response.from_io(io, decompress: false)
client_response.status_code.should eq 404 client_response.status_code.should eq 404

View file

@ -166,7 +166,7 @@ describe "Kemal::RouteHandler" do
end end
it "sets X-Powered-By to Kemal" do it "sets X-Powered-By to Kemal" do
get "/" {} get "/" { }
request = HTTP::Request.new("GET", "/") request = HTTP::Request.new("GET", "/")
client_response = call_request_on_app(request) client_response = call_request_on_app(request)
client_response.headers["X-Powered-By"].should eq("Kemal") client_response.headers["X-Powered-By"].should eq("Kemal")