Sha256: 898ff85db3bb2fc0bba5b4c9b7144d222352d9acb8ddcb963cd34ba2c934ebb3

Contents?: true

Size: 975 Bytes

Versions: 11

Compression:

Stored size: 975 Bytes

Contents

require 'test_helper'

describe PrxAuth::Rails::Configuration do

  subject { PrxAuth::Rails::Configuration.new }

  it 'initializes with a namespace defined by rails app name' do
    assert subject.namespace == :dummy
  end

  it 'can be reconfigured using the namespace attr' do
    PrxAuth::Rails.stub(:configuration, subject) do
      PrxAuth::Rails.configure do |config|
        config.namespace = :new_test
      end

      assert PrxAuth::Rails.configuration.namespace == :new_test
    end
  end

  it 'defaults to enabling the middleware' do
    PrxAuth::Rails.stub(:configuration, subject) do
      assert PrxAuth::Rails.configuration.install_middleware
    end
  end

  it 'allows overriding of the middleware automatic installation' do
    PrxAuth::Rails.stub(:configuration, subject) do
      PrxAuth::Rails.configure do |config|
        config.install_middleware = false
      end

      assert !PrxAuth::Rails.configuration.install_middleware
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
prx_auth-rails-3.0.1 test/prx_auth/rails/configuration_test.rb
prx_auth-rails-3.0.0 test/prx_auth/rails/configuration_test.rb
prx_auth-rails-2.1.0 test/prx_auth/rails/configuration_test.rb
prx_auth-rails-2.0.0 test/prx_auth/rails/configuration_test.rb
prx_auth-rails-1.8.0 test/prx_auth/rails/configuration_test.rb
prx_auth-rails-1.7.0 test/prx_auth/rails/configuration_test.rb
prx_auth-rails-1.6.0 test/prx_auth/rails/configuration_test.rb
prx_auth-rails-1.5.0 test/prx_auth/rails/configuration_test.rb
prx_auth-rails-1.4.1 test/prx_auth/rails/configuration_test.rb
prx_auth-rails-1.4.0 test/prx_auth/rails/configuration_test.rb
prx_auth-rails-1.3.0 test/prx_auth/rails/configuration_test.rb