Refactored context

This commit is contained in:
Sdogruyol 2015-10-30 22:34:44 +02:00
parent 4ce1bc908f
commit a7cc498dca
4 changed files with 8 additions and 13 deletions

View file

@ -14,7 +14,7 @@ describe "Context" do
it "sets content type" do
kemal = Kemal::Handler.new
kemal.add_route "GET", "/" do |env|
env.set_content_type "application/json"
env.content_type = "application/json"
end
request = HTTP::Request.new("GET", "/")
response = kemal.call(request)
@ -37,7 +37,7 @@ describe "Context" do
it "sets response headers" do
kemal = Kemal::Handler.new
kemal.add_route "GET", "/" do |env|
env.set_header "Accept-Language", "tr"
env.add_header "Accept-Language", "tr"
end
request = HTTP::Request.new("GET", "/")
response = kemal.call(request)