Sha256: 4b70499579eef200c89802ec1d0a7fd920dc0a982336c8fd8ac31980b11f03ef

Contents?: true

Size: 1.36 KB

Versions: 15

Compression:

Stored size: 1.36 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 'can be public' do
      lambda { subject.recipients!(:public => true) }.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

15 entries across 15 versions & 1 rubygems

Version Path
groupdocs-1.9.0 spec/support/shared_examples/signature/shared/recipient_methods.rb
groupdocs-1.8.1 spec/support/shared_examples/signature/shared/recipient_methods.rb
groupdocs-1.8.0 spec/support/shared_examples/signature/shared/recipient_methods.rb
groupdocs-1.7.0 spec/support/shared_examples/signature/shared/recipient_methods.rb
groupdocs-1.6.0 spec/support/shared_examples/signature/shared/recipient_methods.rb
groupdocs-1.5.9 spec/support/shared_examples/signature/shared/recipient_methods.rb
groupdocs-1.5.8 spec/support/shared_examples/signature/shared/recipient_methods.rb
groupdocs-1.5.7 spec/support/shared_examples/signature/shared/recipient_methods.rb
groupdocs-1.5.6 spec/support/shared_examples/signature/shared/recipient_methods.rb
groupdocs-1.5.5 spec/support/shared_examples/signature/shared/recipient_methods.rb
groupdocs-1.5.4 spec/support/shared_examples/signature/shared/recipient_methods.rb
groupdocs-1.5.3 spec/support/shared_examples/signature/shared/recipient_methods.rb
groupdocs-1.5.2 spec/support/shared_examples/signature/shared/recipient_methods.rb
groupdocs-1.5.1 spec/support/shared_examples/signature/shared/recipient_methods.rb
groupdocs-1.5.0 spec/support/shared_examples/signature/shared/recipient_methods.rb