spec/groupdocs/signature/field_spec.rb in groupdocs-1.2.11 vs spec/groupdocs/signature/field_spec.rb in groupdocs-1.3.0
- old
+ new
@@ -9,16 +9,16 @@
mock_api_server(load_json('signature_fields_get'))
end
it 'accepts access credentials hash' do
lambda do
- described_class.get!({}, client_id: 'client_id', private_key: 'private_key')
+ described_class.get!({}, :client_id => 'client_id', :private_key => 'private_key')
end.should_not raise_error(ArgumentError)
end
it 'allows passing options' do
- -> { described_class.get!(id: "dsaoij3928ukr03") }.should_not raise_error(ArgumentError)
+ lambda { described_class.get!(:id => "dsaoij3928ukr03") }.should_not raise_error(ArgumentError)
end
it 'returns array of GroupDocs::Signature::Field objects' do
fields = described_class.get!
fields.should be_an(Array)
@@ -77,31 +77,31 @@
it { should alias_accessor(:text_rows, :textRows) }
it { should alias_accessor(:text_columns, :textColumns) }
describe '#location=' do
it 'converts location to GroupDocs::Signature::Field::Location object if hash is passed' do
- subject.location = { id: 'location1' }
+ subject.location = { :id => 'location1' }
subject.location.should be_a(GroupDocs::Signature::Field::Location)
end
it 'saves each location if it is GroupDocs::Signature::Field::Location object' do
- location = GroupDocs::Signature::Field::Location.new(id: 'location')
+ location = GroupDocs::Signature::Field::Location.new(:id => 'location')
subject.location = location
subject.location.should == location
end
it 'appends location to locations if it is not empty' do
- location1 = GroupDocs::Signature::Field::Location.new(id: 'location1')
- location2 = GroupDocs::Signature::Field::Location.new(id: 'location2')
+ location1 = GroupDocs::Signature::Field::Location.new(:id => 'location1')
+ location2 = GroupDocs::Signature::Field::Location.new(:id => 'location2')
subject.locations = [location1]
subject.location = location2
subject.locations.should == [location1, location2]
end
it 'creates locations if it is empty' do
subject.locations = nil
- location = GroupDocs::Signature::Field::Location.new(id: 'location')
+ location = GroupDocs::Signature::Field::Location.new(:id => 'location')
subject.location = location
subject.locations.should == [location]
end
it 'does nothing if nil is passed' do
@@ -111,21 +111,21 @@
end
end
describe '#locations=' do
it 'converts each location to GroupDocs::Signature::Field::Location object if hash is passed' do
- subject.locations = [{ id: 'location1' }]
+ subject.locations = [{ :id => 'location1' }]
locations = subject.locations
locations.should be_an(Array)
locations.each do |location|
location.should be_a(GroupDocs::Signature::Field::Location)
end
end
it 'saves each location if it is GroupDocs::Signature::Field::Location object' do
- location1 = GroupDocs::Signature::Field::Location.new(id: 'location1')
- location2 = GroupDocs::Signature::Field::Location.new(id: 'location2')
+ location1 = GroupDocs::Signature::Field::Location.new(:id => 'location1')
+ location2 = GroupDocs::Signature::Field::Location.new(:id => 'location2')
subject.locations = [location1, location2]
subject.locations.should include(location1)
subject.locations.should include(location2)
end
@@ -168,11 +168,11 @@
mock_api_server(load_json('signature_field_add'))
end
it 'accepts access credentials hash' do
lambda do
- subject.create!(client_id: 'client_id', private_key: 'private_key')
+ subject.create!(:client_id => 'client_id', :private_key => 'private_key')
end.should_not raise_error(ArgumentError)
end
it 'uses hashed version of self as request body' do
subject.should_receive(:to_hash)
@@ -191,11 +191,11 @@
mock_api_server(load_json('signature_field_add'))
end
it 'accepts access credentials hash' do
lambda do
- subject.modify!(client_id: 'client_id', private_key: 'private_key')
+ subject.modify!(:client_id => 'client_id', :private_key => 'private_key')
end.should_not raise_error(ArgumentError)
end
it 'uses hashed version of self as request body' do
subject.should_receive(:to_hash)
@@ -208,10 +208,10 @@
mock_api_server('{ "status": "Ok", "result": { "field": null }}')
end
it 'accepts access credentials hash' do
lambda do
- subject.delete!(client_id: 'client_id', private_key: 'private_key')
+ subject.delete!(:client_id => 'client_id', :private_key => 'private_key')
end.should_not raise_error(ArgumentError)
end
end
end