Sha256: 3ed45a30773e88eb59c77b504b847e94cad16cac83f31056629fd5a4c36e594f

Contents?: true

Size: 1.42 KB

Versions: 12

Compression:

Stored size: 1.42 KB

Contents

shared_examples_for GroupDocs::Signature::ResourceMethods do

  describe '.resources!' do
    before(:each) do
      mock_api_server(load_json('envelopes_resources'))
    end

    it 'accepts access credentials hash' do
      lambda do
        described_class.resources!({}, client_id: 'client_id', private_key: 'private_key')
      end.should_not raise_error(ArgumentError)
    end

    it 'allows passing options' do
      -> { described_class.resources!(status_ids: %w(sdfj943fjof043fj)) }.should_not raise_error(ArgumentError)
    end

    it 'returns resources hash' do
      described_class.resources!.should be_a(Hash)
    end

    it 'returns hash with documents as array of GroupDocs::Document objects' do
      documents = described_class.resources![:documents]
      documents.should be_an(Array)
      documents.each do |document|
        document.should be_a(GroupDocs::Document)
      end
    end

    it 'returns hash with recipients as array of GroupDocs::Signature::Recipient objects' do
      recipients = described_class.resources![:recipients]
      recipients.should be_an(Array)
      recipients.each do |recipient|
        recipient.should be_a(GroupDocs::Signature::Recipient)
      end
    end

    it 'returns hash with other values as array of strings' do
      dates = described_class.resources![:dates]
      dates.should be_an(Array)
      dates.each do |date|
        date.should be_a(String)
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
groupdocs-1.2.11 spec/support/shared_examples/signature/shared/resource_methods.rb
groupdocs-1.2.10 spec/support/shared_examples/signature/shared/resource_methods.rb
groupdocs-1.2.9 spec/support/shared_examples/signature/shared/resource_methods.rb
groupdocs-1.2.8 spec/support/shared_examples/signature/shared/resource_methods.rb
groupdocs-1.2.7 spec/support/shared_examples/signature/shared/resource_methods.rb
groupdocs-1.2.6 spec/support/shared_examples/signature/shared/resource_methods.rb
groupdocs-1.2.3 spec/support/shared_examples/signature/shared/resource_methods.rb
groupdocs-1.2.2 spec/support/shared_examples/signature/shared/resource_methods.rb
groupdocs-1.2.1 spec/support/shared_examples/signature/shared/resource_methods.rb
groupdocs-1.2.0 spec/support/shared_examples/signature/shared/resource_methods.rb
groupdocs-1.1.0 spec/support/shared_examples/signature/shared/resource_methods.rb
groupdocs-1.0.0 spec/support/shared_examples/signature/shared/resource_methods.rb