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-1.0.0.pre5 spec/unit/namespace/authorization_spec.rb