CRs suggestions

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

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

@ -6,11 +6,11 @@ describe Carto::SamlService do
Carto::SamlService.new(@organization)
end
before(:all) do
before(:each) do
@organization = FactoryGirl.create(:saml_organization)
end
after(:all) do
after(:each) do
@organization.delete
end
@ -27,8 +27,12 @@ describe Carto::SamlService do
service.enabled?.should be_true
end
it 'email_attribute not the default if defined' do
service.send(:email_attribute).should eq 'username'
it 'email_attribute doesnt return the default value if its defined' do
saml_config = @organization.auth_saml_configuration
saml_config['email_attribute'] = 'defined_username'
service.send(:email_attribute).should eq 'defined_username'
saml_config['email_attribute'] = nil
service.send(:email_attribute).should eq 'name_id'
end
end

Loading…
Cancel
Save