Sha256: 0d2310f5f1633a9724fdccc7b65ffb51c2df444b3d54d0f3647398dfd617c128

Contents?: true

Size: 873 Bytes

Versions: 5

Compression:

Stored size: 873 Bytes

Contents

# encoding: utf-8
require 'spec_helper'

describe NexaasID::Configuration do
  subject do
    described_class.build do |c|
      c.url = 'http://some/where'
      c.user_agent = 'My App v1.0'
      c.application_token = 'some-app-token'
      c.application_secret = 'some-app-secret'
    end
  end

  it "should use the production Nexaas ID URL by default" do
    expect(subject.url).to eq('http://some/where')
  end

  it "should use a default user agent" do
    expect(subject.user_agent).to eq('My App v1.0')
  end

  it 'generates an URL to a resource' do
    configuration = subject

    expect(configuration.url_for('/api/v1/profile')).
      to eq('http://some/where/api/v1/profile')

    configuration.url = 'https://sandbox.id.nexaas.com/'
    expect(configuration.url_for('/api/v1/profile'))
      .to eq('https://sandbox.id.nexaas.com/api/v1/profile')
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

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