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 / clients / locations_spec.rb
Size: Mime:
require 'spec_helper'

RSpec.describe AppointmentPlus::Client::Customers do
  before do
    @client = AppointmentPlus::Client.new({api_key: "test-key", site_id: "test-id"})
  end

  describe '#locations' do
    before do
      stub_request(:post, "https://test-id:test-key@ws.appointment-plus.com/Locations/GetLocations?response_type=json").
         with(:body => "{\"response_type\":\"json\"}",
              :headers => {'Accept'=>'*/*', 'Accept-Encoding'=>'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Content-Type'=>'application/json', 'User-Agent'=>'Faraday v0.9.2'}).
         to_return(:status => 200, :body => "", :headers => {})
    end

    it "should return a list of locations" do
      @client.locations

      expect(a_get(@client, "Locations/GetLocations?response_type=json")).to have_been_made
    end
  end

end