Sha256: aaac905d4641457570a47cdbb96e63ed71510c2d3a6716ef01221cea753f1e50

Contents?: true

Size: 1.68 KB

Versions: 1

Compression:

Stored size: 1.68 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 respond_to(:emailAddress)  }
  it { should respond_to(:emailAddress=) }
  it { should respond_to(:FullName)      }
  it { should respond_to(:FullName=)     }

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

Version data entries

1 entries across 1 versions & 1 rubygems

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