Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
activeadmin / spec / unit / namespace / authorization_spec.rb
Size: Mime:
require 'rails_helper'

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