Sha256: 2d51b3e93a101b2240ad7387cb745d5b046e42042ad4d68a8fe8f87961c9d5d3

Contents?: true

Size: 457 Bytes

Versions: 11

Compression:

Stored size: 457 Bytes

Contents

module RememberTokenHelpers
  def request_with_remember_token(remember_token)
    cookies = {
      'action_dispatch.cookies' => {
        Clearance::Session::REMEMBER_TOKEN_COOKIE => remember_token
      }
    }
    env = { clearance: Clearance::Session.new(cookies) }
    Rack::Request.new env
  end

  def request_without_remember_token
    request_with_remember_token nil
  end
end

RSpec.configure do |config|
  config.include RememberTokenHelpers
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
clearance-1.7.0 spec/support/request_with_remember_token.rb
clearance-1.6.1 spec/support/request_with_remember_token.rb
clearance-1.6.0 spec/support/request_with_remember_token.rb
clearance-1.5.1 spec/support/request_with_remember_token.rb
clearance-1.5.0 spec/support/request_with_remember_token.rb
clearance-1.4.3 spec/support/request_with_remember_token.rb
clearance-1.4.2 spec/support/request_with_remember_token.rb
clearance-1.4.1 spec/support/request_with_remember_token.rb
clearance-1.4.0 spec/support/request_with_remember_token.rb
clearance-1.3.0 spec/support/request_with_remember_token.rb
clearance-1.2.1 spec/support/request_with_remember_token.rb