Repository URL to install this package:
|
Version:
0.0.1 ▾
|
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