Sha256: add82fcdbe7f3173397cf27cb45eee01dd8f5bcf0abb0599e3b7633136c0acb7

Contents?: true

Size: 1.46 KB

Versions: 5

Compression:

Stored size: 1.46 KB

Contents

require 'spec_helper'

describe NexaasID::Client::Identity do
  describe 'implicit default configuration' do
    subject do
      described_class.new(user_credentials(NexaasID.default_configuration))
    end

    describe '#profile' do
      it 'provides the profile resource' do
        VCR.use_cassette('identity/refresh_token') do
          expect(subject.profile).to be_a(NexaasID::Resources::Profile)
        end
      end
    end
  end

  describe 'explicit configuration' do
    subject do
      described_class.new(user_credentials(configuration), configuration)
    end

    let(:configuration) { default_configuration }

    describe '#profile' do
      it 'provides the profile resource' do
        VCR.use_cassette('identity/refresh_token') do
          expect(subject.profile).to be_a(NexaasID::Resources::Profile)
        end
      end
    end

    describe '#sign_up' do
      it 'provides the signup resource' do
        VCR.use_cassette('identity/refresh_token') do
          expect(subject.sign_up).to be_a(NexaasID::Resources::SignUp)
        end
      end
    end

    describe '#sign_up' do
      it 'provides the widget resource' do
        VCR.use_cassette('identity/refresh_token') do
          expect(subject.widget).to be_a(NexaasID::Resources::Widget)
        end
      end
    end

    describe '#credentials' do
      it 'returns the updated credentials' do
        expect(subject.credentials).to eq(user_credentials(configuration))
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
nexaas_id-client-0.7.4 spec/nexaas_id/client/identity_spec.rb
nexaas_id-client-0.7.3 spec/nexaas_id/client/identity_spec.rb
nexaas_id-client-0.7.2 spec/nexaas_id/client/identity_spec.rb
nexaas_id-client-0.7.1 spec/nexaas_id/client/identity_spec.rb
nexaas_id-client-0.7.0 spec/nexaas_id/client/identity_spec.rb