Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
appointment_plus / spec / appointment_plus_spec.rb
Size: Mime:
require 'spec_helper'

RSpec.describe AppointmentPlus do
  after do
    AppointmentPlus.reset
  end

  describe ".client" do
    it "should be a AppointmentPlus::Client" do
      expect(AppointmentPlus.client).to be_a(AppointmentPlus::Client)
    end
  end

  describe '#api_key' do
    it 'should return the default api key' do
      expect(AppointmentPlus.api_key).to eq(AppointmentPlus::Configuration::DEFAULT_API_KEY)
    end
  end

  describe '#api_key=' do
    it 'should set the api key' do
      AppointmentPlus.api_key = 'test-key'
      expect(AppointmentPlus.api_key).to eq('test-key')
    end
  end

  describe '#site_id' do
    it 'should return the default site id' do
      expect(AppointmentPlus.site_id).to eq(AppointmentPlus::Configuration::DEFAULT_SITE_ID)
    end
  end

  describe '#site_id=' do
    it 'should set the site_id' do
      AppointmentPlus.site_id = 'test-id'
      expect(AppointmentPlus.site_id).to eq('test-id')
    end
  end

  describe '#adapter' do
    it 'should return the default adapter' do
      expect(AppointmentPlus.adapter).to eq(AppointmentPlus::Configuration::DEFAULT_ADAPTER)
    end
  end

  describe '#adapter=' do
    it 'should set the adapter' do
      AppointmentPlus.adapter = :typhoeus
      expect(AppointmentPlus.adapter).to eq(:typhoeus)
    end
  end

  describe '#endpoint' do
    it 'should return the default endpoint' do
      expect(AppointmentPlus.endpoint).to eq(AppointmentPlus::Configuration::DEFAULT_ENDPOINT)
    end
  end

  describe '#endpoint=' do
    it 'should set the endpoint' do
      AppointmentPlus.endpoint = 'http://www.google.com'
      expect(AppointmentPlus.endpoint).to eq('http://www.google.com')
    end
  end

  describe '#configure' do
    AppointmentPlus::Configuration::VALID_OPTIONS_KEYS.each do |key|

      it "should set the #{key}" do
        AppointmentPlus.configure do |config|
          config.send("#{key}=", key)
          expect(AppointmentPlus.send(key)).to eq(key)
        end
      end
    end
  end
end