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

RSpec.describe Razorsync::Client::ServiceRequests do
  before do
    @client = Razorsync::Client.new({token: "TestToken", portal_name: "TestPortal"})
  end

  describe '#service_request_list' do
    before do
      stub_request(:post, "https://testportal.0.razorsync.com/ApiService.svc/ServiceRequest/List").
         with(:headers => {'Accept'=>'*/*', 'Accept-Encoding'=>'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Content-Length'=>'0', 'Content-Type'=>'application/json', 'Host'=>'TestPortal.0.razorsync.com', 'Servername'=>'TestPortal', 'Token'=>'TestToken', 'User-Agent'=>'Faraday v0.9.2'}).
         to_return(:status => 200, :body => fixture('service_requests_list.json'))
    end

    it "should return a list of service requests" do
      @client.service_request_list

      expect(a_get(:post, "ServiceRequest/List", @client.portal_name)).to have_been_made
    end
  end

  describe '#service_request' do
    before do
      stub_request(:get, "https://testportal.0.razorsync.com/ApiService.svc/ServiceRequest/294").
        with(:headers => {'Accept'=>'*/*', 'Accept-Encoding'=>'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Host'=>'TestPortal.0.razorsync.com', 'Servername'=>'TestPortal', 'Token'=>'TestToken', 'User-Agent'=>'Faraday v0.9.2'}).
        to_return(:status => 200, :body => fixture('service_requests_list.json'))
    end

    it "should return a service request" do
      @client.service_request(294)

      expect(a_get(:get, "ServiceRequest/294", @client.portal_name)).to have_been_made
    end
  end

end