gitlab-org--gitlab-foss/spec/helpers/oauth_helper_spec.rb

21 lines
654 B
Ruby
Raw Normal View History

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] }
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] }
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) { [] }
expect(helper.additional_providers).to eq([])
2014-12-04 05:55:37 -05:00
end
end
end