BigW Consortium Gitlab

oauth_helper_spec.rb 653 Bytes
Newer Older
Valery Sizov committed
1 2 3 4
require "spec_helper"

describe OauthHelper do
  describe "additional_providers" do
Valery Sizov committed
5 6
    it 'returns all enabled providers' do
      allow(helper).to receive(:enabled_oauth_providers) { [:twitter, :github] }
7
      expect(helper.additional_providers).to include(*[:twitter, :github])
Valery Sizov committed
8 9 10 11
    end

    it 'does not return ldap provider' do
      allow(helper).to receive(:enabled_oauth_providers) { [:twitter, :ldapmain] }
12
      expect(helper.additional_providers).to include(:twitter)
Valery Sizov committed
13 14 15 16
    end

    it 'returns empty array' do
      allow(helper).to receive(:enabled_oauth_providers) { [] }
17
      expect(helper.additional_providers).to eq([])
Valery Sizov committed
18 19 20
    end
  end
end