Sha256: 2edba33bc5e9e2d6ffcee950364cec9ecbd935633a3fc7a73646b847f09cc03c

Contents?: true

Size: 807 Bytes

Versions: 21

Compression:

Stored size: 807 Bytes

Contents

require 'rails_helper'

RSpec.describe ActiveAdmin::Resource, "authorization" do

  let(:app){ ActiveAdmin::Application.new }
  let(:namespace){ ActiveAdmin::Namespace.new(app, :admin) }
  let(:auth){ double }

  describe "authorization_adapter" do

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

    it "should be settable on the namespace" do
      namespace.authorization_adapter = auth
      expect(namespace.authorization_adapter).to eq auth
    end

    it "should be settable on the application" do
      app.authorization_adapter = auth
      expect(app.authorization_adapter).to eq auth
    end

  end
end

Version data entries

21 entries across 21 versions & 4 rubygems

Version Path
activeadmin-rails-1.7.1 spec/unit/namespace/authorization_spec.rb
activeadmin-rails-1.7.0 spec/unit/namespace/authorization_spec.rb
activeadmin-rb-1.6.0 spec/unit/namespace/authorization_spec.rb
activeadmin-rb-1.5.2 spec/unit/namespace/authorization_spec.rb
activeadmin-rb-1.5.1 spec/unit/namespace/authorization_spec.rb
activeadmin-rb-1.5.0 spec/unit/namespace/authorization_spec.rb
activeadmin_addons-1.7.1 vendor/bundle/ruby/2.3.0/bundler/gems/activeadmin-f71b375325eb/spec/unit/namespace/authorization_spec.rb
activeadmin-rb-1.4.0 spec/unit/namespace/authorization_spec.rb
activeadmin_addons-1.7.0 vendor/bundle/ruby/2.3.0/bundler/gems/activeadmin-f71b375325eb/spec/unit/namespace/authorization_spec.rb
activeadmin-1.3.1 spec/unit/namespace/authorization_spec.rb
activeadmin_addons-1.6.0 vendor/bundle/ruby/2.3.0/bundler/gems/activeadmin-f71b375325eb/spec/unit/namespace/authorization_spec.rb
activeadmin_addons-1.5.0 vendor/bundle/ruby/2.2.0/bundler/gems/activeadmin-f71b375325eb/spec/unit/namespace/authorization_spec.rb
activeadmin-1.3.0 spec/unit/namespace/authorization_spec.rb
activeadmin_addons-1.4.0 vendor/bundle/ruby/2.2.0/bundler/gems/activeadmin-f71b375325eb/spec/unit/namespace/authorization_spec.rb
activeadmin_addons-1.3.0 vendor/bundle/ruby/2.3.0/bundler/gems/activeadmin-f71b375325eb/spec/unit/namespace/authorization_spec.rb
activeadmin_addons-1.2.0 vendor/bundle/ruby/2.3.0/bundler/gems/activeadmin-f71b375325eb/spec/unit/namespace/authorization_spec.rb
activeadmin-1.2.1 spec/unit/namespace/authorization_spec.rb
activeadmin-1.2.0 spec/unit/namespace/authorization_spec.rb
activeadmin-1.1.0 spec/unit/namespace/authorization_spec.rb
activeadmin-1.0.0 spec/unit/namespace/authorization_spec.rb