summaryrefslogtreecommitdiff
path: root/spec/helpers/oauth_helper_spec.rb
blob: 088c342fa13c7b34742261cf980256c5dea6be54 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
require "spec_helper"

describe OauthHelper do
  describe "additional_providers" do
    it 'returns all enabled providers' do
      allow(helper).to receive(:enabled_oauth_providers) { [:twitter, :github] }
      expect(helper.additional_providers).to include(*[:twitter, :github])
    end

    it 'does not return ldap provider' do
      allow(helper).to receive(:enabled_oauth_providers) { [:twitter, :ldapmain] }
      expect(helper.additional_providers).to include(:twitter)
    end

    it 'returns empty array' do
      allow(helper).to receive(:enabled_oauth_providers) { [] }
      expect(helper.additional_providers).to eq([])
    end
  end
end