spec/groupdocs/document/annotation_spec.rb in groupdocs-1.9.0 vs spec/groupdocs/document/annotation_spec.rb in groupdocs-2.0.0
- old
+ new
@@ -31,11 +31,10 @@
it { should alias_accessor(:reply_guid, :replyGuid) }
# Annotation#created_on is overwritten
it { should have_alias(:created_on=, :createdOn=) }
it { should alias_accessor(:annotation_position, :annotationPosition) }
-
it { should have_alias(:annotationGuid=, :guid=) }
describe '#initialize' do
it 'raises error if document is not specified' do
lambda { described_class.new }.should raise_error(ArgumentError)
@@ -142,18 +141,17 @@
mock_api_server(load_json('annotation_create'))
end
it 'accepts access credentials hash' do
lambda do
- subject.create!('info', :client_id => 'client_id', :private_key => 'private_key')
- end.should_not raise_error(ArgumentError)
+ subject.create!(%w(info), :client_id => 'client_id', :private_key => 'private_key')
+ end.should_not raise_error()
end
-
it 'updated self with response values' do
lambda do
- subject.create!('info')
+ subject.create! :box => '10', :annotationPosition => '100'
end.should change {
subject.id
subject.guid
subject.document_guid
subject.reply_guid
@@ -168,11 +166,11 @@
end
it 'accepts access credentials hash' do
lambda do
subject.remove!(:client_id => 'client_id', :private_key => 'private_key')
- end.should_not raise_error(ArgumentError)
+ end.should_not raise_error()
end
end
describe '#replies!' do
it 'calls GroupDocs::Document::Annotation::Reply.get!' do
@@ -187,11 +185,11 @@
end
it 'accepts access credentials hash' do
lambda do
subject.move!(10, 10, :client_id => 'client_id', :private_key => 'private_key')
- end.should_not raise_error(ArgumentError)
+ end.should_not raise_error()
end
it 'updates annotation position' do
lambda do
subject.move!(10, 10)
@@ -202,61 +200,31 @@
describe '#move_marker!' do
before(:each) do
mock_api_server('{ "status": "Ok", "result": {}}')
end
+ let(:marker) { GroupDocs::Document::Annotation::MarkerPosition.new(:position => {:x => 1, :y => 1}, :page=>1)}
+1
it 'accepts access credentials hash' do
lambda do
subject.move_marker!(marker, :client_id => 'client_id', :private_key => 'private_key')
- end.should_not raise_error(ArgumentError)
+ end.should_not raise_error()
end
- end
-
- describe '#resize!' do
- before(:each) do
- mock_api_server('{ "status": "Ok", "result": {}}')
+ it 'raises error if marker is not GroupDocs::Document::Annotation::MarkerPosition object' do
+ lambda { subject.move_marker!(['MarkerPosition']) }.should raise_error(ArgumentError)
end
- it 'accepts access credentials hash' do
- lambda do
- subject.resize!(10, 10, :client_id => 'client_id', :private_key => 'private_key')
- end.should_not raise_error(ArgumentError)
- end
end
- describe '#text_info!' do
- before(:each) do
- mock_api_server('{ "status": "Ok", "result": {}}')
- end
-
- it 'accepts access credentials hash' do
- lambda do
- subject.text_info!(fieldText, fontFamily, fontSize, :client_id => 'client_id', :private_key => 'private_key')
- end.should_not raise_error(ArgumentError)
- end
- end
-
- describe '#text_color!' do
- before(:each) do
- mock_api_server('{ "status": "Ok", "result": {}}')
- end
-
- it 'accepts access credentials hash' do
- lambda do
- subject.text_color!(font_color :client_id => 'client_id', :private_key => 'private_key')
- end.should_not raise_error(ArgumentError)
- end
- end
-
describe '#set_access!' do
before(:each) do
mock_api_server(load_json('annotation_access_set'))
end
it 'accepts access credentials hash' do
lambda do
subject.set_access!(:private, :client_id => 'client_id', :private_key => 'private_key')
- end.should_not raise_error(ArgumentError)
+ end.should_not raise_error()
end
it 'updates annotation access mode' do
subject.set_access!(:private)
subject.access.should == :private