diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2015-06-16 14:16:52 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2015-06-16 14:16:52 -0700 |
commit | 685ef70e715c3d1ee9360dd87eb47bd2b933fd17 (patch) | |
tree | b2219ecfb03e15a4c9c2b82b8596407ca317f270 /test/spec_session_cookie.rb | |
parent | c99a755a3f55f0769245e7a22dd000b471f77d88 (diff) | |
parent | 694c7034fe1cdbf21daeef2898851e0fc8381601 (diff) | |
download | rack-685ef70e715c3d1ee9360dd87eb47bd2b933fd17.tar.gz |
Merge branch 'master' into zenspider-minitest.phase.2
* master:
Cleanup older code than Ruby 2.0+ one
extract a `make_cookie_header` method
Fix encoding issue in source files
Use ::Encoding instead of Parser::Encoding
FIX: Backwards compatibility with soupy data
Force encoding of parsed filename
Feature: Provided support for non-ascii character in public header
Simplify regular expressions and extract the extended filename
Move RFC2183 constant too
Start updating definitions for RFC 2231
Add failing test
replace OkJson in favor of the JSON gem
Constantize all rack environment variables and make them frozen
set the logger to nil
update history
Added media_type methods in Rack::Response
raise an exception if the parameters are too deep
Handle param parsing errors in MethodOverride silently
Conflicts:
rack.gemspec
test/spec_chunked.rb
test/spec_lint.rb
test/spec_multipart.rb
test/spec_request.rb
test/spec_session_cookie.rb
test/spec_utils.rb
test/spec_version.rb
Diffstat (limited to 'test/spec_session_cookie.rb')
-rw-r--r-- | test/spec_session_cookie.rb | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/test/spec_session_cookie.rb b/test/spec_session_cookie.rb index 2b7be77a..492a1cd9 100644 --- a/test/spec_session_cookie.rb +++ b/test/spec_session_cookie.rb @@ -106,13 +106,13 @@ describe Rack::Session::Cookie do it 'marshals and base64 encodes' do coder = Rack::Session::Cookie::Base64::JSON.new obj = %w[fuuuuu] - coder.encode(obj).must_equal [::Rack::Utils::OkJson.encode(obj)].pack('m') + coder.encode(obj).must_equal [::JSON.dump(obj)].pack('m') end it 'marshals and base64 decodes' do coder = Rack::Session::Cookie::Base64::JSON.new - str = [::Rack::Utils::OkJson.encode(%w[fuuuuu])].pack('m') - coder.decode(str).must_equal ::Rack::Utils::OkJson.decode(str.unpack('m').first) + str = [::JSON.dump(%w[fuuuuu])].pack('m') + coder.decode(str).must_equal ::JSON.parse(str.unpack('m').first) end it 'rescues failures on decode' do @@ -125,14 +125,14 @@ describe Rack::Session::Cookie do it 'jsons, deflates, and base64 encodes' do coder = Rack::Session::Cookie::Base64::ZipJSON.new obj = %w[fuuuuu] - json = Rack::Utils::OkJson.encode(obj) + json = JSON.dump(obj) coder.encode(obj).must_equal [Zlib::Deflate.deflate(json)].pack('m') end it 'base64 decodes, inflates, and decodes json' do coder = Rack::Session::Cookie::Base64::ZipJSON.new obj = %w[fuuuuu] - json = Rack::Utils::OkJson.encode(obj) + json = JSON.dump(obj) b64 = [Zlib::Deflate.deflate(json)].pack('m') coder.decode(b64).must_equal obj end |