Commit 4f3ee34e authored by Valery Sizov's avatar Valery Sizov
Browse files

added helper

parent d1556fc6cdea
......@@ -16,4 +16,8 @@
[:twitter, :github, :google_oauth2].include?(name.to_sym)
end
end
def additional_providers
enabled_oauth_providers.reject{|provider| provider.to_s.starts_with?('ldap')}
end
end
- providers = enabled_oauth_providers.reject{|provider| provider.to_s.starts_with?('ldap')}
- providers = additional_providers
- if providers.present?
.bs-callout.bs-callout-info{:'data-no-turbolink' => 'data-no-turbolink'}
%span Sign in with:  
......
require "spec_helper"
describe OauthHelper do
describe "additional_providers" do
it 'returns appropriate values' do
[
[[:twitter, :github], [:twitter, :github]],
[[:ldap_main], []],
[[:twitter, :ldap_main], [:twitter]],
[[], []],
].each do |couple|
allow(helper).to receive(:enabled_oauth_providers) { couple.first }
additional_providers.should include(*couple.last)
end
end
end
end
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment