Sha256: 1957632fb49f8832ab842760383d838253c0b8e28ead7a1f5174c41047be8bee

Contents?: true

Size: 1.73 KB

Versions: 18

Compression:

Stored size: 1.73 KB

Contents

require 'spec_helper'

describe HelloSign::Api::Template do
  describe '#get_template' do
    before do
      stub_get('/template/1', 'template')
      @template = HelloSign.get_template :template_id => 1
    end

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

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

  describe '#get_templates' do
    before do
      stub_get('/template/list', 'templates')
      @template = HelloSign.get_templates({})
    end

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

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

    it 'each of Array is an Template' do
      expect(@template[0]).to be_an HelloSign::Resource::Template
    end
  end

  describe '#add_user_to_template' do
    before do
      stub_post('/template/add_user/1', 'template')
      @template = HelloSign.add_user_to_template :template_id => 1
    end

    it 'should get the correct resource' do
      expect(a_post('/template/add_user/1')).to have_been_made
    end

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

  describe '#remove_user_from_template' do
    before do
      stub_post('/template/remove_user/1', 'template')
      @template = HelloSign.remove_user_from_template :template_id => 1
    end

    it 'should get the correct resource' do
      expect(a_post('/template/remove_user/1')).to have_been_made
    end

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

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
hellosign-ruby-sdk-3.2.0 spec/hello_sign/api/template_spec.rb
hellosign-ruby-sdk-3.1.0 spec/hello_sign/api/template_spec.rb
hellosign-ruby-sdk-3.0.22 spec/hello_sign/api/template_spec.rb
hellosign-ruby-sdk-3.0.21 spec/hello_sign/api/template_spec.rb
hellosign-ruby-sdk-3.0.20 spec/hello_sign/api/template_spec.rb
hellosign-ruby-sdk-3.0.19 spec/hello_sign/api/template_spec.rb
hellosign-ruby-sdk-3.0.18 spec/hello_sign/api/template_spec.rb
hellosign-ruby-sdk-3.0.17 spec/hello_sign/api/template_spec.rb
hellosign-ruby-sdk-3.0.15 spec/hello_sign/api/template_spec.rb
hellosign-ruby-sdk-3.0.14 spec/hello_sign/api/template_spec.rb
hellosign-ruby-sdk-3.0.12 spec/hello_sign/api/template_spec.rb
hellosign-ruby-sdk-3.0.11 spec/hello_sign/api/template_spec.rb
hellosign-ruby-sdk-3.0.10 spec/hello_sign/api/template_spec.rb
hellosign-ruby-sdk-3.0.9 spec/hello_sign/api/template_spec.rb
hellosign-ruby-sdk-3.0.7 spec/hello_sign/api/template_spec.rb
hellosign-ruby-sdk-3.0.6 spec/hello_sign/api/template_spec.rb
hellosign-ruby-sdk-3.0.5 spec/hello_sign/api/template_spec.rb
hellosign-ruby-sdk-3.0.4 spec/hello_sign/api/template_spec.rb