Going green: Symbolize keys when SamlService gets the config

pull/13161/head
Mario de Frutos 7 years ago
parent 72338eaf9a
commit 4e6a0188e8
No known key found for this signature in database
GPG Key ID: A206D1F8FCA8D2B5

@ -125,7 +125,8 @@ module Carto
end
def carto_saml_configuration
@organization.try(:auth_saml_configuration)
saml_config = @organization.try(:auth_saml_configuration)
saml_config ? saml_config.deep_symbolize_keys : nil
end
end
end

@ -61,7 +61,7 @@ describe Carto::SamlService do
it 'returns the user with matching email' do
user = create_test_saml_user
response_mock.stubs(:is_valid?).returns(true)
response_mock.stubs(:attributes).returns(saml_config[:email_attribute] => user.email)
response_mock.stubs(:attributes).returns(saml_config['email_attribute'] => user.email)
service.get_user_email(saml_response_param_mock).should eq user.email

Loading…
Cancel
Save