Sha256: 4b28239466e29a1d80cc6c856e05e89696d4be328b3667307a9ade9e8b3ac888

Contents?: true

Size: 380 Bytes

Versions: 4

Compression:

Stored size: 380 Bytes

Contents

require "securerandom"
require_relative "../lib/tynn/session"

test "session" do
  Tynn.plugin(Tynn::Session, secret: SecureRandom.hex(64))

  Tynn.define do
    root do
      session[:foo] = "foo"

      res.write(session[:foo])
    end
  end

  app = Tynn::Test.new
  app.get("/")

  assert_equal "foo", app.res.body
  assert_equal "foo", app.req.env["rack.session"]["foo"]
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
tynn-1.4.0 test/session_test.rb
tynn-1.3.0 test/session_test.rb
tynn-1.2.0 test/session_test.rb
tynn-1.1.0 test/session_test.rb