Make session name and expire time configurable

This commit is contained in:
Sdogruyol 2016-09-29 22:11:01 +03:00 committed by Serdar Dogruyol
parent 6d4bf575cb
commit 8c600cb26e
4 changed files with 15 additions and 12 deletions

View file

@ -23,6 +23,14 @@ describe "Config" do
config.host_binding.should eq "127.0.0.1"
end
it "sets session values" do
config = Kemal.config
config.session["name"] = "kemal"
config.session["expire_time"] = 1.hours
config.session["name"].as(String).should eq "kemal"
config.session["expire_time"].as(Time::Span).should eq 1.hours
end
it "adds a custom handler" do
config = Kemal.config
config.add_handler CustomTestHandler.new