Sha256: 4b93360f374d189168fffed3b98e11d24f6d461d67947dbf86a1145c0529924d

Contents?: true

Size: 1.5 KB

Versions: 19

Compression:

Stored size: 1.5 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(ArgumentError)
    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(ArgumentError)
    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

19 entries across 19 versions & 1 rubygems

Version Path
groupdocs-1.9.0 spec/groupdocs/document/annotation/reviewer_spec.rb
groupdocs-1.8.1 spec/groupdocs/document/annotation/reviewer_spec.rb
groupdocs-1.8.0 spec/groupdocs/document/annotation/reviewer_spec.rb
groupdocs-1.7.0 spec/groupdocs/document/annotation/reviewer_spec.rb
groupdocs-1.6.0 spec/groupdocs/document/annotation/reviewer_spec.rb
groupdocs-1.5.9 spec/groupdocs/document/annotation/reviewer_spec.rb
groupdocs-1.5.8 spec/groupdocs/document/annotation/reviewer_spec.rb
groupdocs-1.5.7 spec/groupdocs/document/annotation/reviewer_spec.rb
groupdocs-1.5.6 spec/groupdocs/document/annotation/reviewer_spec.rb
groupdocs-1.5.5 spec/groupdocs/document/annotation/reviewer_spec.rb
groupdocs-1.5.4 spec/groupdocs/document/annotation/reviewer_spec.rb
groupdocs-1.5.3 spec/groupdocs/document/annotation/reviewer_spec.rb
groupdocs-1.5.2 spec/groupdocs/document/annotation/reviewer_spec.rb
groupdocs-1.5.1 spec/groupdocs/document/annotation/reviewer_spec.rb
groupdocs-1.5.0 spec/groupdocs/document/annotation/reviewer_spec.rb
groupdocs-1.4.2 spec/groupdocs/document/annotation/reviewer_spec.rb
groupdocs-1.4.1 spec/groupdocs/document/annotation/reviewer_spec.rb
groupdocs-1.4.0 spec/groupdocs/document/annotation/reviewer_spec.rb
groupdocs-1.3.0 spec/groupdocs/document/annotation/reviewer_spec.rb