Skip to content

Commit

Permalink
add spec to validate blank sessions are not stored in redis
Browse files Browse the repository at this point in the history
  • Loading branch information
mstruve committed Sep 26, 2018
1 parent e735cea commit 53493e8
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions test/rack/session/redis_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,12 @@
sesion_store.threadsafe?.must_equal(true)
end

it "does not store a blank session" do
session_store = Rack::Session::Redis.new(incrementor)
sid = session_store.generate_unique_sid({})
session_store.with { |c| c.get(sid).must_be_nil }
end

it "locks the store mutex" do
mutex = Mutex.new
mutex.expects(:lock).once
Expand Down

0 comments on commit 53493e8

Please sign in to comment.