Sha256: ff26fe94f38e4aeeb0167dc0e413b99d7581bacabf14095150543e5739f38b6c

Contents?: true

Size: 1.19 KB

Versions: 1

Compression:

Stored size: 1.19 KB

Contents

require 'spec_helper'

class User; end
class Identity; end

describe Socialite do
  context "configuration" do
    it 'is configurable through .setup' do
      Socialite.setup do |c|
        c.should be_kind_of(Module)
      end
    end

    describe 'configuring classes' do
      before do
        Socialite.setup do |c|
          c.user_class = 'User'
          c.identity_class = 'Identity'
        end
      end

      its(:user_class) { should eql(User) }
      its(:identity_class) { should eql(Identity) }
    end

    describe 'accepting provider information' do
      before do
        Socialite.providers = nil
        Socialite.setup do |c|
          c.provider :facebook, 'xyz', '123'
          c.provider :twitter, 'abc', '789'
        end
      end

      subject { Socialite.providers }

      its(:size) { should == 2 }

      describe 'holds all the provider parameters for OmniAuth' do
        it 'has facebook data' do
          subject.first[0].should == :facebook
          subject.first[1].should == ['xyz', '123']
        end

        it 'has twitter data' do
          subject.last[0].should == :twitter
          subject.last[1].should == ['abc', '789']
        end
      end

    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
socialite-0.1.0.pre spec/socialite_spec.rb