Sha256: cf8587397abae48ef8eeba194f4dff14decccc5d80a58f29c43fec2122d65057

Contents?: true

Size: 1.48 KB

Versions: 1

Compression:

Stored size: 1.48 KB

Contents

require 'spec_helper'

describe GroupDocs::Document::Annotation::Reviewer do

  it_behaves_like GroupDocs::Api::Entity

  describe '.all!' do
    before(:each) do
      mock_api_server(load_json('annotation_reviewers_get'))
    end

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

    it 'returns an array of GroupDocs::Document::Annotation::Reviewer objects' do
      reviewers = described_class.all!
      reviewers.should be_an(Array)
      reviewers.each do |reviewer|
        reviewer.should be_a(GroupDocs::Document::Annotation::Reviewer)
      end
    end
  end

  describe '.set!' do
    before(:each) do
      mock_api_server(load_json('annotation_reviewers_get'))
    end

    let!(:reviewers) { [described_class.new(:email_address => 'test@test.com')] }

    it 'accepts access credentials hash' do
      lambda do
        described_class.set!(reviewers, :client_id => 'client_id', :private_key => 'private_key')
      end.should_not raise_error()
    end

    it 'uses hashed version of reviewers' do
      reviewers.each do |reviewer|
        reviewer.should_receive(:to_hash)
      end
      described_class.set! reviewers
    end
  end

  it { should have_accessor(:emailAddress) }
  it { should have_accessor(:FullName)     }

  it { should alias_accessor(:email_address, :emailAddress) }
  it { should alias_accessor(:full_name, :FullName)         }
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
groupdocs-2.0.0 spec/groupdocs/document/annotation/reviewer_spec.rb