Sha256: 0381fb63fdebdd7b8b308b129113a785ef6138a39e6f023837fca7f7998fe90e
Contents?: true
Size: 787 Bytes
Versions: 20
Compression:
Stored size: 787 Bytes
Contents
RSpec.describe Rails::Auth::ControllerMethods do let(:controller_class) do Class.new do attr_reader :request def initialize(env) @request = OpenStruct.new(env: env) end include Rails::Auth::ControllerMethods end end describe "#credentials" do let(:example_credential_type) { "x509" } let(:example_credential_value) { instance_double(Rails::Auth::X509::Certificate) } let(:example_env) { Rails::Auth.add_credential({}, example_credential_type, example_credential_value) } let(:example_controller) { controller_class.new(example_env) } it "extracts credentials from the Rack environment" do expect(example_controller.credentials[example_credential_type.to_sym]).to eq example_credential_value end end end
Version data entries
20 entries across 20 versions & 1 rubygems