Sha256: 68afaecd361664fd8b9c87dc4f67a33e446449bbd6a3158851340315eafd27ae

Contents?: true

Size: 854 Bytes

Versions: 3

Compression:

Stored size: 854 Bytes

Contents

require 'spec_helper'
require 'survey_gizmo/configuration'

describe SurveyGizmo::Configuration do

  before(:each) do
    SurveyGizmo.configure do |config|
      config.user = 'test@test.com'
      config.password = 'password'
    end
  end

  after(:each) do
    SurveyGizmo.reset!
  end

  it 'should allow basic authentication configuration' do
    expect(SurveyGizmo.default_params).to eq({ 'user:md5' => 'test@test.com:5f4dcc3b5aa765d61d8327deb882cf99' })
  end

  it 'should allow changing user and pass' do
    SurveyGizmo.configure do |config|
      config.user = 'slimthug'
      config.password = 'fourfourz'
      config.api_version = 'v3'
    end

    expect(SurveyGizmo.default_params).to eq({ 'user:md5'=>'slimthug:836fd7e2961a094c01cb7ba78bac6a06' })
    expect(SurveyGizmo.base_uri).to eq('https://restapi.surveygizmo.com/v3')
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
survey-gizmo-ruby-4.1.0 spec/configuration_spec.rb
survey-gizmo-ruby-4.0.0 spec/configuration_spec.rb
survey-gizmo-ruby-3.0.3 spec/configuration_spec.rb