Sha256: 7d0cb62ae3bdb8fd8f335befa99a4626c0a5872f9f4bbab984829be66df4b12e

Contents?: true

Size: 807 Bytes

Versions: 7

Compression:

Stored size: 807 Bytes

Contents

require 'spec_helper'

describe ActiveAdmin::Resource, "authorization" do

  let(:app){ ActiveAdmin::Application.new }
  let(:namespace){ ActiveAdmin::Namespace.new(app, :admin) }
  let(:mock_auth){ mock }

  describe "authorization_adapter" do

    it "should return AuthorizationAdapter by default" do
      app.authorization_adapter.should       eq ActiveAdmin::AuthorizationAdapter
      namespace.authorization_adapter.should eq ActiveAdmin::AuthorizationAdapter
    end

    it "should be settable on the namespace" do
      namespace.authorization_adapter = mock_auth
      namespace.authorization_adapter.should eq mock_auth
    end

    it "should be settable on the application" do
      app.authorization_adapter = mock_auth
      app.authorization_adapter.should eq mock_auth
    end

  end
end

Version data entries

7 entries across 7 versions & 2 rubygems

Version Path
activeadmin-0.6.6 spec/unit/namespace/authorization_spec.rb
activeadmin-0.6.5 spec/unit/namespace/authorization_spec.rb
activeadmin-0.6.4 spec/unit/namespace/authorization_spec.rb
activeadmin-0.6.3 spec/unit/namespace/authorization_spec.rb
activeadmin-0.6.2 spec/unit/namespace/authorization_spec.rb
activeadmin-0.6.1 spec/unit/namespace/authorization_spec.rb
aa-rails4-0.6.0 spec/unit/namespace/authorization_spec.rb