Sha256: 3c50010370c18ee7d2a8a86c5173d0de72aacbfa8fa3d7f12d87ade99409e36f

Contents?: true

Size: 501 Bytes

Versions: 8

Compression:

Stored size: 501 Bytes

Contents

RSpec.describe Rails::Auth::Credentials::InjectorMiddleware do
  let(:request)     { Rack::MockRequest.env_for("https://www.example.com") }
  let(:app)         { ->(env) { [200, env, "Hello, world!"] } }
  let(:middleware)  { described_class.new(app, credentials) }
  let(:credentials) { { "foo" => "bar" } }

  it "overrides rails-auth credentials in the rack environment" do
    _response, env = middleware.call(request)
    expect(env[Rails::Auth::CREDENTIALS_ENV_KEY]).to eq credentials
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
rails-auth-1.3.0 spec/rails/auth/credentials/injector_middleware_spec.rb
rails-auth-1.2.0 spec/rails/auth/credentials/injector_middleware_spec.rb
rails-auth-1.1.0 spec/rails/auth/credentials/injector_middleware_spec.rb
rails-auth-1.0.0 spec/rails/auth/credentials/injector_middleware_spec.rb
rails-auth-0.5.3 spec/rails/auth/credentials/injector_middleware_spec.rb
rails-auth-0.5.2 spec/rails/auth/credentials/injector_middleware_spec.rb
rails-auth-0.5.1 spec/rails/auth/credentials/injector_middleware_spec.rb
rails-auth-0.5.0 spec/rails/auth/credentials/injector_middleware_spec.rb