Sha256: c79429a7e9bcd6e970e8baa780835d10a3d1972040337503ee58704b71df3155
Contents?: true
Size: 854 Bytes
Versions: 10
Compression:
Stored size: 854 Bytes
Contents
require File.expand_path(File.dirname(__FILE__) + '/../test_helper') require 'rack/facebook_session' require 'rack/lint' require 'rack/mock' class Rack::FacebookSessionTest < Test::Unit::TestCase def setup @app = lambda do |env| @env = env Rack::Response.new().to_a end @facebook = Rack::FacebookSession.new(@app, '_top_sekrit') end def params(p) p.map{|*args| args.join('=') }.join('&') end def app Rack::MockRequest.new(Rack::Lint.new(@facebook)) end def test_converts_session_key_on_get response = app.get '/?' + params(:fb_sig_session_key => 'foo') assert_equal '_top_sekrit=foo', @env['HTTP_COOKIE'] end def test_converts_session_key_on_post response = app.post '/', :input => params(:fb_sig_session_key => 'foo') assert_equal '_top_sekrit=foo', @env['HTTP_COOKIE'] end end
Version data entries
10 entries across 10 versions & 4 rubygems