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-2.9.2 spec/clearance/constraints/signed_out_spec.rb
clearance-2.9.1 spec/clearance/constraints/signed_out_spec.rb
clearance-2.9.0 spec/clearance/constraints/signed_out_spec.rb
clearance-2.8.0 spec/clearance/constraints/signed_out_spec.rb
clearance-2.7.2 spec/clearance/constraints/signed_out_spec.rb
clearance-2.7.0 spec/clearance/constraints/signed_out_spec.rb
clearance-2.6.2 spec/clearance/constraints/signed_out_spec.rb
clearance-2.6.1 spec/clearance/constraints/signed_out_spec.rb
clearance-2.6.0 spec/clearance/constraints/signed_out_spec.rb
clearance-2.5.0 spec/clearance/constraints/signed_out_spec.rb
clearance-2.4.0 spec/clearance/constraints/signed_out_spec.rb
clearance-2.3.1 spec/clearance/constraints/signed_out_spec.rb
clearance-2.3.0 spec/clearance/constraints/signed_out_spec.rb
clearance-2.2.1 spec/clearance/constraints/signed_out_spec.rb
clearance-2.2.0 spec/clearance/constraints/signed_out_spec.rb
clearance-2.1.0 spec/clearance/constraints/signed_out_spec.rb
clearance-2.0.0 spec/clearance/constraints/signed_out_spec.rb
clearance-2.0.0.beta2 spec/clearance/constraints/signed_out_spec.rb
clearance-2.0.0.beta1 spec/clearance/constraints/signed_out_spec.rb
clearance-1.17.0 spec/clearance/constraints/signed_out_spec.rb