Sha256: bd059a9bcfcfc2fc9ba50842fd8af8560e13a1333fe22505746b705eefe21c37

Contents?: true

Size: 750 Bytes

Versions: 42

Compression:

Stored size: 750 Bytes

Contents

require 'spec_helper'

describe Clearance::Constraints::SignedOut do
  it 'returns true when user is signed out' do
    constraint = Clearance::Constraints::SignedOut.new
    request = request_without_remember_token
    expect(constraint.matches?(request)).to eq true
  end

  it 'returns false when user is not signed out' do
    user = create(:user)
    constraint = Clearance::Constraints::SignedOut.new
    request = request_with_remember_token(user.remember_token)
    expect(constraint.matches?(request)).to eq false
  end

  it 'returns true when clearance info is missing from request' do
    constraint = Clearance::Constraints::SignedOut.new
    request = Rack::Request.new({})
    expect(constraint.matches?(request)).to eq true
  end
end

Version data entries

42 entries across 42 versions & 1 rubygems

Version Path
clearance-1.16.2 spec/clearance/constraints/signed_out_spec.rb
clearance-1.16.1 spec/clearance/constraints/signed_out_spec.rb
clearance-1.16.0 spec/clearance/constraints/signed_out_spec.rb
clearance-1.15.1 spec/clearance/constraints/signed_out_spec.rb
clearance-1.15.0 spec/clearance/constraints/signed_out_spec.rb
clearance-1.14.2 spec/clearance/constraints/signed_out_spec.rb
clearance-1.14.1 spec/clearance/constraints/signed_out_spec.rb
clearance-1.14.0 spec/clearance/constraints/signed_out_spec.rb
clearance-1.13.0 spec/clearance/constraints/signed_out_spec.rb
clearance-1.12.1 spec/clearance/constraints/signed_out_spec.rb
clearance-1.12.0 spec/clearance/constraints/signed_out_spec.rb
clearance-1.11.0 spec/clearance/constraints/signed_out_spec.rb
clearance-1.10.1 spec/clearance/constraints/signed_out_spec.rb
clearance-1.9.0 spec/clearance/constraints/signed_out_spec.rb
clearance-1.8.1 spec/clearance/constraints/signed_out_spec.rb
clearance-1.8.0 spec/clearance/constraints/signed_out_spec.rb
clearance-1.7.0 spec/clearance/constraints/signed_out_spec.rb
clearance-1.6.1 spec/clearance/constraints/signed_out_spec.rb
clearance-1.6.0 spec/clearance/constraints/signed_out_spec.rb
clearance-1.5.1 spec/clearance/constraints/signed_out_spec.rb