Sha256: 7ce3903549895838835555cfa07a146dc1d36ddb8ac157f0467404029aac0798

Contents?: true

Size: 1.47 KB

Versions: 10

Compression:

Stored size: 1.47 KB

Contents

require 'spec_helper'

describe HelloSign::Api::BulkSendJob do
  describe '#get_bulk_send_job' do
    before do
      stub_get('/bulk_send_job/1', 'bulk_send_job')
      @bulk_send = HelloSign.get_bulk_send_job :bulk_send_job_id => 1
    end

    it 'should get the correct resource' do
      expect(a_get('/bulk_send_job/1')).to have_been_made
    end

    it 'should return response headers' do
      expect(@bulk_send.headers).to_not be_nil
    end

    it 'should return a Bulk Send Job' do
      expect(@bulk_send).to be_an HelloSign::Resource::BulkSendJob
    end
  end

  describe '#get_bulk_send_jobs' do
    before do
      stub_get('/bulk_send_job/list', 'bulk_send_jobs')
      @bulk_send_jobs = HelloSign.get_bulk_send_jobs({})
    end

    it 'should get the correct resource' do
      expect(a_get('/bulk_send_job/list')).to have_been_made
    end

    it 'returns reponse headers' do
      expect(@bulk_send_jobs.headers).to_not be_nil
    end

    it 'should return a ResourceArray' do
      expect(@bulk_send_jobs).to be_an HelloSign::Resource::ResourceArray
    end

    it 'each of Array is a BulkSendJob' do
      expect(@bulk_send_jobs[0]).to be_an HelloSign::Resource::BulkSendJob
    end

    it 'should return list_info as a BaseResource in results' do
      expect(@bulk_send_jobs[0].list_info).to be_an HelloSign::Resource::BaseResource
    end

    it 'should return page numbers as an integer' do
      expect(@bulk_send_jobs[0].list_info.page).to be_an Integer
    end
  end
end

Version data entries

10 entries across 10 versions & 2 rubygems

Version Path
hellosign-api-1.0.7 spec/hello_sign/api/bulk_send_job_spec.rb
hellosign-api-1.0.6 spec/hello_sign/api/bulk_send_job_spec.rb
hellosign-api-1.0.5 spec/hello_sign/api/bulk_send_job_spec.rb
hellosign-api-1.0.4 spec/hello_sign/api/bulk_send_job_spec.rb
hellosign-api-1.0.3 spec/hello_sign/api/bulk_send_job_spec.rb
hellosign-api-1.0.2 spec/hello_sign/api/bulk_send_job_spec.rb
hellosign-api-1.0.1 spec/hello_sign/api/bulk_send_job_spec.rb
hellosign-api-1.0.0 spec/hello_sign/api/bulk_send_job_spec.rb
hellosign-ruby-sdk-3.7.7 spec/hello_sign/api/bulk_send_job_spec.rb
hellosign-ruby-sdk-3.7.6 spec/hello_sign/api/bulk_send_job_spec.rb