From ed84b6d665c36bd24d0934e38ba440e95d52633e Mon Sep 17 00:00:00 2001 From: Doug McInnes Date: Thu, 18 Jun 2015 17:54:07 -0700 Subject: allow users to disable the secure cookie warning for custom coders --- test/spec_session_cookie.rb | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'test/spec_session_cookie.rb') diff --git a/test/spec_session_cookie.rb b/test/spec_session_cookie.rb index 492a1cd9..479db2c3 100644 --- a/test/spec_session_cookie.rb +++ b/test/spec_session_cookie.rb @@ -152,6 +152,21 @@ describe Rack::Session::Cookie do @warnings.must_be :empty? end + it "doesn't warn if coder is configured to handle encoding" do + Rack::Session::Cookie.new( + incrementor, + :coder => Object.new, + :let_coder_handle_secure_encoding => true) + @warnings.must_be :empty? + end + + it "still warns if coder is not set" do + Rack::Session::Cookie.new( + incrementor, + :let_coder_handle_secure_encoding => true) + @warnings.first.must_match(/no secret/i) + end + it 'uses a coder' do identity = Class.new { attr_reader :calls -- cgit v1.2.1