spec/groupdocs/job_spec.rb in groupdocs-1.2.9 vs spec/groupdocs/job_spec.rb in groupdocs-1.2.10
- old
+ new
@@ -149,20 +149,32 @@
it 'updates job status' do
subject.documents!
subject.status.should == :archived
end
- it 'returns array of GroupDocs::Document objects' do
- documents = subject.documents!
+ it 'returns hash' do
+ subject.documents!.should be_a(Hash)
+ end
+
+ it 'returns array of input documents' do
+ documents = subject.documents![:inputs]
documents.should be_an(Array)
documents.each do |document|
document.should be_a(GroupDocs::Document)
end
end
- it 'returns empty array if null is returned instead of inputs array' do
+ it 'returns array of output documents' do
+ documents = subject.documents![:outputs]
+ documents.should be_an(Array)
+ documents.each do |document|
+ document.should be_a(GroupDocs::Document)
+ end
+ end
+
+ it 'returns empty arrays if there are no documents' do
mock_api_server('{ "status": "Ok", "result": {}}')
- subject.documents!.should be_empty
+ subject.documents!.should == { inputs: [], outputs: [] }
end
end
describe '#add_document!' do
before(:each) do