Sha256: 84a0ef0e032dc38cd0d02e314c5ddb3a72705ae095c7907ea6fbb0419feb61c0

Contents?: true

Size: 940 Bytes

Versions: 2

Compression:

Stored size: 940 Bytes

Contents

require 'spec_helper'
require 'support/cookieless_controller'


class SubCookieController < CookielessController

  def index
    render text: "SubCookieController#Index"
  end

protected

  def default_url_options
    super.except(session_key)
  end
end


describe SubCookieController do

  it "doesn't include session_key in default_url_options" do
    controller.stub(:session_key).and_return('some_session_key')
    controller.stub(:session_id).and_return('some_session_id')

    controller.send(:default_url_options).should_not include('some_session_key')
  end

  it "doesn't include session_key=session_id in generated path or url" do
    controller.stub(:session_key).and_return('some_session_key')
    controller.stub(:session_id).and_return('some_session_id')

    controller.root_path.should_not include("some_session_key=some_session_id")
    controller.root_url.should_not include("some_session_key=some_session_id")
  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
cookieless_sessions-1.0.1 spec/controllers/sub_cookie_controller_from_cookieless_controller_spec.rb
cookieless_sessions-1.0.0 spec/controllers/sub_cookie_controller_from_cookieless_controller_spec.rb