Sha256: 44ec03a00827d7ed3bfd71d1916e846b38436d555e7411355d08cb367ff73d24

Contents?: true

Size: 1023 Bytes

Versions: 36

Compression:

Stored size: 1023 Bytes

Contents

require File.expand_path(File.dirname(__FILE__) + '/../../simple_spec_helper')

describe Lolita::Extensions::Authentication::DefaultAdapter do
  let(:klass){ Lolita::Extensions::Authentication::DefaultAdapter }
  let(:adapter){ klass.new(Object.new,{}) }

  it "should create new DefaultAdapter" do
    expect do
      klass.new(Object.new,{})
    end.not_to raise_error
  end

  it "should not have current user" do
    adapter.current_user.should be_nil
  end

  it "should not be signed in" do
    adapter.user_signed_in?.should be_false
  end

  it "should authenticate user" do
    adapter.authenticate_user!.should be_true
  end

  describe 'Integration with proxy' do
    let(:proxy){ Lolita::Extensions::Authentication::Proxy.new(Object.new,{}) }
      it "should have the same method results for adapter and proxy" do
        proxy.adapter = adapter
        %w(current_user user_signed_in? authenticate_user!).each do |name|
          proxy.send(name).should eql(adapter.send(name))
        end
      end
  end
end

Version data entries

36 entries across 36 versions & 1 rubygems

Version Path
lolita-4.0.11 spec/extensions/authentication/default_adapter_spec.rb
lolita-4.2.0 spec/extensions/authentication/default_adapter_spec.rb
lolita-4.0.10 spec/extensions/authentication/default_adapter_spec.rb
lolita-4.0.9 spec/extensions/authentication/default_adapter_spec.rb
lolita-4.0.8 spec/extensions/authentication/default_adapter_spec.rb
lolita-4.0.7 spec/extensions/authentication/default_adapter_spec.rb
lolita-4.0.6 spec/extensions/authentication/default_adapter_spec.rb
lolita-4.0.5 spec/extensions/authentication/default_adapter_spec.rb
lolita-4.0.4 spec/extensions/authentication/default_adapter_spec.rb
lolita-4.0.3 spec/extensions/authentication/default_adapter_spec.rb
lolita-4.0.2 spec/extensions/authentication/default_adapter_spec.rb
lolita-4.0.1 spec/extensions/authentication/default_adapter_spec.rb
lolita-4.0.0 spec/extensions/authentication/default_adapter_spec.rb
lolita-3.4.3 spec/extensions/authentication/default_adapter_spec.rb
lolita-3.4.2 spec/extensions/authentication/default_adapter_spec.rb
lolita-3.4.1 spec/extensions/authentication/default_adapter_spec.rb
lolita-3.4.0 spec/extensions/authentication/default_adapter_spec.rb
lolita-3.3.9 spec/extensions/authentication/default_adapter_spec.rb
lolita-3.3.8 spec/extensions/authentication/default_adapter_spec.rb
lolita-3.3.7 spec/extensions/authentication/default_adapter_spec.rb