Sha256: 77ba607da536483d35387e82177a6992319fdf2d688b0eef3ce47f6ee7afed07

Contents?: true

Size: 1.49 KB

Versions: 36

Compression:

Stored size: 1.49 KB

Contents

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

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

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

  it "should have #current_user" do
    proxy.respond_to?(:current_user).should be_true
  end
  
  it "should have #user_signed_in?" do
    proxy.respond_to?(:user_signed_in?).should be_true
  end

  it "should have #adapter" do
    proxy.adapter.is_a?(Object)
  end

  it "should have #authenticate_user!" do
    proxy.respond_to?(:authenticate_user!).should be_true
  end

  it "should have #sign_out_path" do
    proxy.respond_to?(:sign_out_path).should be_true
  end

  it "should have #sign_out_via" do
    proxy.respond_to?(:sign_out_via).should be_true
  end

  it "should have #edit_path" do
    proxy.respond_to?(:edit_path).should be_true
  end

  describe 'Connecting adapter' do
    context 'default adapter' do
      it "should create when Authentication is not specified" do
        proxy.adapter.should be_a(Lolita::Extensions::Authentication::DefaultAdapter)
      end
    end
    context 'devise adapter' do
      it "should create when Lolita.authentication is specified" do
        Lolita.authentication = :test
        proxy.adapter.should be_a(Lolita::Extensions::Authentication::DeviseAdapter)
        Lolita.authentication = nil
      end
    end
  end
end

Version data entries

36 entries across 36 versions & 1 rubygems

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