2014-12-04 05:55:37 -05:00
|
|
|
require "spec_helper"
|
|
|
|
|
|
|
|
describe OauthHelper do
|
|
|
|
describe "additional_providers" do
|
2014-12-04 06:43:08 -05:00
|
|
|
it 'returns all enabled providers' do
|
|
|
|
allow(helper).to receive(:enabled_oauth_providers) { [:twitter, :github] }
|
2015-02-12 13:17:35 -05:00
|
|
|
expect(helper.additional_providers).to include(*[:twitter, :github])
|
2014-12-04 06:43:08 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
it 'does not return ldap provider' do
|
|
|
|
allow(helper).to receive(:enabled_oauth_providers) { [:twitter, :ldapmain] }
|
2015-02-12 13:17:35 -05:00
|
|
|
expect(helper.additional_providers).to include(:twitter)
|
2014-12-04 06:43:08 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
it 'returns empty array' do
|
|
|
|
allow(helper).to receive(:enabled_oauth_providers) { [] }
|
2015-02-12 13:17:35 -05:00
|
|
|
expect(helper.additional_providers).to eq([])
|
2014-12-04 05:55:37 -05:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|