Sha256: f05236bf5a86caf3d009f293e9dd5d1c19298e9ebc9f52a54347fa915af6a176

Contents?: true

Size: 1.23 KB

Versions: 4

Compression:

Stored size: 1.23 KB

Contents

shared_examples_for GroupDocs::Signature::RecipientMethods do

  describe '#recipients!' do
    before(:each) do
      mock_api_server(load_json('template_get_recipients'))
    end

    it 'accepts access credentials hash' do
      lambda do
        subject.recipients!(:client_id => 'client_id', :private_key => 'private_key')
      end.should_not raise_error(ArgumentError)
    end

    it 'returns array of GroupDocs::Signature::Recipient objects' do
      recipients = subject.recipients!
      recipients.should be_an(Array)
      recipients.each do |recipient|
        recipient.should be_a(GroupDocs::Signature::Recipient)
      end
    end
  end

  describe '#remove_recipient!' do
    let(:recipient) do
      GroupDocs::Signature::Recipient.new
    end

    before(:each) do
      mock_api_server('{ "status": "Ok", "result": {}}')
    end

    it 'accepts access credentials hash' do
      lambda do
        subject.remove_recipient!(recipient, :client_id => 'client_id', :private_key => 'private_key')
      end.should_not raise_error(ArgumentError)
    end

    it 'raises error if recipient is not GroupDocs::Signature::Recipient object' do
      lambda { subject.remove_recipient!('Recipient') }.should raise_error(ArgumentError)
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
groupdocs-1.4.2 spec/support/shared_examples/signature/shared/recipient_methods.rb
groupdocs-1.4.1 spec/support/shared_examples/signature/shared/recipient_methods.rb
groupdocs-1.4.0 spec/support/shared_examples/signature/shared/recipient_methods.rb
groupdocs-1.3.0 spec/support/shared_examples/signature/shared/recipient_methods.rb