groupdocs 1.9.0 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (57) hide show
  1. data/CHANGELOG.md +13 -0
  2. data/README.md +1 -1
  3. data/examples/api-samples/Gemfile +1 -1
  4. data/examples/api-samples/Gemfile.lock +29 -23
  5. data/examples/api-samples/public/css/style.css +10 -2
  6. data/examples/api-samples/public/docs/sample11.html +11 -7
  7. data/examples/api-samples/samples/sample11.rb +4 -6
  8. data/examples/api-samples/views/_others_samples.haml +231 -91
  9. data/examples/api-samples/views/index.haml +230 -92
  10. data/examples/api-samples/views/sample07.haml +1 -1
  11. data/examples/api-samples/web.rb +1 -0
  12. data/groupdocs.gemspec +2 -2
  13. data/lib/groupdocs/api.rb +1 -0
  14. data/lib/groupdocs/document.rb +12 -0
  15. data/lib/groupdocs/document/annotation.rb +5 -0
  16. data/lib/groupdocs/document/annotation/marker.rb +1 -1
  17. data/lib/groupdocs/document/editor.rb +13 -1
  18. data/lib/groupdocs/document/metadata.rb +6 -0
  19. data/lib/groupdocs/document/option.rb +9 -0
  20. data/lib/groupdocs/signature/form.rb +4 -6
  21. data/lib/groupdocs/storage/file.rb +1 -2
  22. data/lib/groupdocs/version.rb +1 -1
  23. data/spec/groupdocs/api/helpers/access_rights_helper_spec.rb +3 -3
  24. data/spec/groupdocs/api/helpers/byte_flag_helper_spec.rb +2 -2
  25. data/spec/groupdocs/datasource_spec.rb +5 -46
  26. data/spec/groupdocs/document/annotation/reply_spec.rb +5 -5
  27. data/spec/groupdocs/document/annotation/reviewer_spec.rb +2 -2
  28. data/spec/groupdocs/document/annotation_spec.rb +11 -43
  29. data/spec/groupdocs/document_spec.rb +61 -298
  30. data/spec/groupdocs/job_spec.rb +20 -74
  31. data/spec/groupdocs/questionnaire/collector_spec.rb +8 -8
  32. data/spec/groupdocs/questionnaire/execution_spec.rb +6 -6
  33. data/spec/groupdocs/questionnaire_spec.rb +28 -58
  34. data/spec/groupdocs/signature/contact_spec.rb +7 -7
  35. data/spec/groupdocs/signature/envelope_spec.rb +30 -34
  36. data/spec/groupdocs/signature/field_spec.rb +5 -5
  37. data/spec/groupdocs/signature/form_spec.rb +28 -16
  38. data/spec/groupdocs/signature/list_spec.rb +3 -3
  39. data/spec/groupdocs/signature/role_spec.rb +2 -2
  40. data/spec/groupdocs/signature/template_spec.rb +4 -4
  41. data/spec/groupdocs/signature_spec.rb +7 -20
  42. data/spec/groupdocs/storage/file_spec.rb +24 -80
  43. data/spec/groupdocs/storage/folder_spec.rb +14 -14
  44. data/spec/groupdocs/storage/package_spec.rb +2 -2
  45. data/spec/groupdocs/storage_spec.rb +1 -1
  46. data/spec/groupdocs/subscription_spec.rb +4 -123
  47. data/spec/groupdocs/user_spec.rb +14 -243
  48. data/spec/spec_helper.rb +4 -0
  49. data/spec/support/json/annotation_marker_move.json +11 -0
  50. data/spec/support/json/envelope_recipient_add.json +27 -0
  51. data/spec/support/json/job_documents.json +35 -103
  52. data/spec/support/shared_examples/signature/shared/document_methods.rb +4 -4
  53. data/spec/support/shared_examples/signature/shared/entity_methods.rb +10 -10
  54. data/spec/support/shared_examples/signature/shared/field_methods.rb +14 -18
  55. data/spec/support/shared_examples/signature/shared/recipient_methods.rb +3 -3
  56. data/spec/support/shared_examples/signature/shared/resource_methods.rb +2 -2
  57. metadata +13 -7
@@ -13,13 +13,13 @@ describe GroupDocs::Job do
13
13
  it 'accepts access credentials hash' do
14
14
  lambda do
15
15
  described_class.all!({}, :client_id => 'client_id', :private_key => 'private_key')
16
- end.should_not raise_error(ArgumentError)
16
+ end.should_not raise_error()
17
17
  end
18
18
 
19
19
  it 'accepts options hash' do
20
20
  lambda do
21
21
  described_class.all!(:page => 1, :count => 2)
22
- end.should_not raise_error(ArgumentError)
22
+ end.should_not raise_error()
23
23
  end
24
24
 
25
25
  it 'returns an array of GroupDocs::Job objects' do
@@ -39,7 +39,7 @@ describe GroupDocs::Job do
39
39
  it 'accepts access credentials hash' do
40
40
  lambda do
41
41
  described_class.get!(1, :client_id => 'client_id', :private_key => 'private_key')
42
- end.should_not raise_error(ArgumentError)
42
+ end.should_not raise_error()
43
43
  end
44
44
 
45
45
  it 'returns GroupDocs::Job object' do
@@ -47,40 +47,6 @@ describe GroupDocs::Job do
47
47
  end
48
48
  end
49
49
 
50
- describe '.get_xml!' do
51
- before(:each) do
52
- mock_api_server(load_json('job_get'))
53
- end
54
-
55
- it 'accepts access credentials hash' do
56
- lambda do
57
- described_class.get_xml!(1, :client_id => 'client_id', :private_key => 'private_key')
58
- end.should_not raise_error(ArgumentError)
59
- end
60
-
61
- it 'returns GroupDocs::Job object' do
62
- described_class.get_xml!(1).should be_a(GroupDocs::Job)
63
- end
64
- end
65
-
66
- describe '.get_resources!' do
67
- before(:each) do
68
- mock_api_server(load_json('job_resources_get'))
69
- end
70
-
71
- it 'accepts access credentials hash' do
72
- lambda do
73
- described_class.get_resources!(options, :client_id => 'client_id', :private_key => 'private_key')
74
- end.should_not raise_error(ArgumentError)
75
- end
76
-
77
- it 'accepts options credentials hash' do
78
- lambda do
79
- described_class.get_resources!(:statusIds => 'Draft', :actions => [:convert, :combine], :excluded_actions => 1)
80
- end.should_not raise_error(ArgumentError)
81
- end
82
- end
83
-
84
50
  describe '.create!' do
85
51
  before(:each) do
86
52
  mock_api_server(load_json('job_create'))
@@ -91,7 +57,7 @@ describe GroupDocs::Job do
91
57
  it 'accepts access credentials hash' do
92
58
  lambda do
93
59
  described_class.create!({ :actions => %w(convert) }, :client_id => 'client_id', :private_key => 'private_key')
94
- end.should_not raise_error(ArgumentError)
60
+ end.should_not raise_error()
95
61
  end
96
62
 
97
63
  it 'raises error if actions are passed' do
@@ -103,11 +69,6 @@ describe GroupDocs::Job do
103
69
  described_class.create!(:actions => actions)
104
70
  end
105
71
 
106
- it 'converts array of out formats to string' do
107
- formats = %w(pdf txt)
108
- described_class.create!(:actions => actions, :out_formats => formats)
109
- end
110
-
111
72
  it 'returns GroupDocs::Job object' do
112
73
  described_class.create!(:actions => actions).should be_a(GroupDocs::Job)
113
74
  end
@@ -176,13 +137,13 @@ describe GroupDocs::Job do
176
137
  it 'accepts access credentials hash' do
177
138
  lambda do
178
139
  subject.documents!(:client_id => 'client_id', :private_key => 'private_key')
179
- end.should_not raise_error(ArgumentError)
140
+ end.should_not raise_error()
180
141
  end
181
142
 
182
- #it 'updates job status' do
183
- # subject.documents!
184
- # subject.status.should == :archived
185
- #end
143
+ it 'updates job status' do
144
+ subject.documents!
145
+ subject.status.should == :archived
146
+ end
186
147
 
187
148
  it 'returns hash' do
188
149
  subject.documents!.should be_a(Hash)
@@ -210,24 +171,6 @@ describe GroupDocs::Job do
210
171
  end
211
172
  end
212
173
 
213
- describe '#jobs_documents!' do
214
- before(:each) do
215
- mock_api_server(load_json('jobs_documents'))
216
- end
217
-
218
- it 'accepts access credentials hash' do
219
- lambda do
220
- subject.jobs_documents!({}, :client_id => 'client_id', :private_key => 'private_key')
221
- end.should_not raise_error(ArgumentError)
222
- end
223
-
224
- it 'accepts access credentials hash' do
225
- lambda do
226
- subject.jobs_documents!(:page => 1, :count => 1, :actions => 1, :excluded_actions => 1, :order_by => 'Date', :order_asc => true )
227
- end.should_not raise_error(ArgumentError)
228
- end
229
- end
230
-
231
174
  describe '#add_document!' do
232
175
  before(:each) do
233
176
  mock_api_server(load_json('job_file_add'))
@@ -240,13 +183,13 @@ describe GroupDocs::Job do
240
183
  it 'accepts access credentials hash' do
241
184
  lambda do
242
185
  subject.add_document!(document, {}, :client_id => 'client_id', :private_key => 'private_key')
243
- end.should_not raise_error(ArgumentError)
186
+ end.should_not raise_error()
244
187
  end
245
188
 
246
189
  it 'accepts options hash' do
247
190
  lambda do
248
191
  subject.add_document!(document, :output_formats => %w(pdf txt))
249
- end.should_not raise_error(ArgumentError)
192
+ end.should_not raise_error()
250
193
  end
251
194
 
252
195
  it 'raises error if document is not an instance of GroupDocs::Document' do
@@ -266,7 +209,7 @@ describe GroupDocs::Job do
266
209
  it 'accepts access credentials hash' do
267
210
  lambda do
268
211
  subject.delete_document!('a9ufg8s7dfgsdf', :client_id => 'client_id', :private_key => 'private_key')
269
- end.should_not raise_error(ArgumentError)
212
+ end.should_not raise_error()
270
213
  end
271
214
 
272
215
  it 'returns empty hash' do
@@ -275,6 +218,9 @@ describe GroupDocs::Job do
275
218
  end
276
219
 
277
220
  describe '#add_datasource!' do
221
+ before(:each) do
222
+ mock_api_server('{ "status": "Ok", "result": {}}')
223
+ end
278
224
  let(:document) do
279
225
  GroupDocs::Document.new(:file => GroupDocs::Storage::File.new)
280
226
  end
@@ -286,7 +232,7 @@ describe GroupDocs::Job do
286
232
  it 'accepts access credentials hash' do
287
233
  lambda do
288
234
  subject.add_datasource!(document, datasource, :client_id => 'client_id', :private_key => 'private_key')
289
- end.should_not raise_error(ArgumentError)
235
+ end.should_not raise_error()
290
236
  end
291
237
 
292
238
  it 'raises error if document is not an instance of GroupDocs::Document' do
@@ -308,13 +254,13 @@ describe GroupDocs::Job do
308
254
  it 'accepts access credentials hash' do
309
255
  lambda do
310
256
  subject.add_url!(url, {}, :client_id => 'client_id', :private_key => 'private_key')
311
- end.should_not raise_error(ArgumentError)
257
+ end.should_not raise_error()
312
258
  end
313
259
 
314
260
  it 'accepts options hash' do
315
261
  lambda do
316
262
  subject.add_url!(url, :out_formats => %W(pdf txt))
317
- end.should_not raise_error(ArgumentError)
263
+ end.should_not raise_error()
318
264
  end
319
265
 
320
266
  it 'returns document ID' do
@@ -330,7 +276,7 @@ describe GroupDocs::Job do
330
276
  it 'accepts access credentials hash' do
331
277
  lambda do
332
278
  subject.update!({}, :client_id => 'client_id', :private_key => 'private_key')
333
- end.should_not raise_error(ArgumentError)
279
+ end.should_not raise_error()
334
280
  end
335
281
 
336
282
  it 'parses status' do
@@ -347,7 +293,7 @@ describe GroupDocs::Job do
347
293
  it 'accepts access credentials hash' do
348
294
  lambda do
349
295
  subject.delete!(:client_id => 'client_id', :private_key => 'private_key')
350
- end.should_not raise_error(ArgumentError)
296
+ end.should_not raise_error()
351
297
  end
352
298
  end
353
299
 
@@ -18,7 +18,7 @@ describe GroupDocs::Questionnaire::Collector do
18
18
  it 'accepts access credentials hash' do
19
19
  lambda do
20
20
  described_class.get!('9fh349hfdskf', :client_id => 'client_id', :private_key => 'private_key')
21
- end.should_not raise_error(ArgumentError)
21
+ end.should_not raise_error()
22
22
  end
23
23
 
24
24
  it 'returns GroupDocs::Questionnaire::Collector object' do
@@ -81,7 +81,7 @@ describe GroupDocs::Questionnaire::Collector do
81
81
  it 'accepts access credentials hash' do
82
82
  lambda do
83
83
  subject.add!(:client_id => 'client_id', :private_key => 'private_key')
84
- end.should_not raise_error(ArgumentError)
84
+ end.should_not raise_error()
85
85
  end
86
86
 
87
87
  it 'updates id and guid with response' do
@@ -102,7 +102,7 @@ describe GroupDocs::Questionnaire::Collector do
102
102
  it 'accepts access credentials hash' do
103
103
  lambda do
104
104
  subject.update!(:client_id => 'client_id', :private_key => 'private_key')
105
- end.should_not raise_error(ArgumentError)
105
+ end.should_not raise_error()
106
106
  end
107
107
  end
108
108
 
@@ -114,7 +114,7 @@ describe GroupDocs::Questionnaire::Collector do
114
114
  it 'accepts access credentials hash' do
115
115
  lambda do
116
116
  subject.remove!(:client_id => 'client_id', :private_key => 'private_key')
117
- end.should_not raise_error(ArgumentError)
117
+ end.should_not raise_error()
118
118
  end
119
119
  end
120
120
 
@@ -126,7 +126,7 @@ describe GroupDocs::Questionnaire::Collector do
126
126
  it 'accepts access credentials hash' do
127
127
  lambda do
128
128
  subject.executions!(:client_id => 'client_id', :private_key => 'private_key')
129
- end.should_not raise_error(ArgumentError)
129
+ end.should_not raise_error()
130
130
  end
131
131
 
132
132
  it 'returns an array of GroupDocs::Questionnaire::Execution objects' do
@@ -148,7 +148,7 @@ describe GroupDocs::Questionnaire::Collector do
148
148
  it 'accepts access credentials hash' do
149
149
  lambda do
150
150
  subject.add_execution!(execution, :client_id => 'client_id', :private_key => 'private_key')
151
- end.should_not raise_error(ArgumentError)
151
+ end.should_not raise_error()
152
152
  end
153
153
 
154
154
  it 'raises error if execution is not GroupDocs::Questionnaire::Execution object' do
@@ -177,13 +177,13 @@ describe GroupDocs::Questionnaire::Collector do
177
177
  it 'accepts access credentials hash' do
178
178
  lambda do
179
179
  subject.fill!(datasource, {}, :client_id => 'client_id', :private_key => 'private_key')
180
- end.should_not raise_error(ArgumentError)
180
+ end.should_not raise_error()
181
181
  end
182
182
 
183
183
  it 'accepts options hash' do
184
184
  lambda do
185
185
  subject.fill!(datasource, :new_type => :pdf)
186
- end.should_not raise_error(ArgumentError)
186
+ end.should_not raise_error()
187
187
  end
188
188
 
189
189
  it 'raises error if datasource is not GroupDocs::Datasource object' do
@@ -13,7 +13,7 @@ describe GroupDocs::Questionnaire::Execution do
13
13
  it 'accepts access credentials hash' do
14
14
  lambda do
15
15
  described_class.get!('45dsfh9348uf0fj834y92h', :client_id => 'client_id', :private_key => 'private_key')
16
- end.should_not raise_error(ArgumentError)
16
+ end.should_not raise_error()
17
17
  end
18
18
 
19
19
  it 'returns GroupDocs::Questionnaire::Execution object' do
@@ -87,7 +87,7 @@ describe GroupDocs::Questionnaire::Execution do
87
87
  it 'accepts access credentials hash' do
88
88
  lambda do
89
89
  subject.set_status!(:submitted, :client_id => 'client_id', :private_key => 'private_key')
90
- end.should_not raise_error(ArgumentError)
90
+ end.should_not raise_error()
91
91
  end
92
92
 
93
93
  it 'parses status' do
@@ -109,7 +109,7 @@ describe GroupDocs::Questionnaire::Execution do
109
109
  it 'accepts access credentials hash' do
110
110
  lambda do
111
111
  subject.update!(:client_id => 'client_id', :private_key => 'private_key')
112
- end.should_not raise_error(ArgumentError)
112
+ end.should_not raise_error()
113
113
  end
114
114
 
115
115
  it 'uses hashed version of self as request body' do
@@ -126,7 +126,7 @@ describe GroupDocs::Questionnaire::Execution do
126
126
  it 'accepts access credentials hash' do
127
127
  lambda do
128
128
  subject.delete!(:client_id => 'client_id', :private_key => 'private_key')
129
- end.should_not raise_error(ArgumentError)
129
+ end.should_not raise_error()
130
130
  end
131
131
  end
132
132
 
@@ -142,13 +142,13 @@ describe GroupDocs::Questionnaire::Execution do
142
142
  it 'accepts access credentials hash' do
143
143
  lambda do
144
144
  subject.fill!(datasource, {}, :client_id => 'client_id', :private_key => 'private_key')
145
- end.should_not raise_error(ArgumentError)
145
+ end.should_not raise_error()
146
146
  end
147
147
 
148
148
  it 'accepts options hash' do
149
149
  lambda do
150
150
  subject.fill!(datasource, :new_type => :pdf)
151
- end.should_not raise_error(ArgumentError)
151
+ end.should_not raise_error()
152
152
  end
153
153
 
154
154
  it 'raises error if datasource is not GroupDocs::Datasource object' do
@@ -13,19 +13,19 @@ describe GroupDocs::Questionnaire do
13
13
  it 'accepts access credentials hash' do
14
14
  lambda do
15
15
  described_class.all!({}, :client_id => 'client_id', :private_key => 'private_key')
16
- end.should_not raise_error(ArgumentError)
16
+ end.should_not raise_error()
17
17
  end
18
18
 
19
19
  it 'accepts options hash' do
20
20
  lambda do
21
21
  described_class.all!(:status => :draft)
22
- end.should_not raise_error(ArgumentError)
22
+ end.should_not raise_error()
23
23
  end
24
24
 
25
25
  it 'parses status if passed' do
26
26
  status = :draft
27
27
  subject = described_class.new
28
- described_class.should_receive(:new).any_number_of_times.and_return(subject)
28
+ described_class.should_receive(:new).at_least(1).times.and_return(subject)
29
29
  subject.should_receive(:parse_status).with(status)
30
30
  described_class.all!(:status => status)
31
31
  end
@@ -47,7 +47,7 @@ describe GroupDocs::Questionnaire do
47
47
  it 'accepts access credentials hash' do
48
48
  lambda do
49
49
  described_class.get!(1, :client_id => 'client_id', :private_key => 'private_key')
50
- end.should_not raise_error(ArgumentError)
50
+ end.should_not raise_error()
51
51
  end
52
52
 
53
53
  it 'returns GroupDocs::Questionnaire object' do
@@ -120,7 +120,7 @@ describe GroupDocs::Questionnaire do
120
120
  it 'accepts access credentials hash' do
121
121
  lambda do
122
122
  subject.create!(:client_id => 'client_id', :private_key => 'private_key')
123
- end.should_not raise_error(ArgumentError)
123
+ end.should_not raise_error()
124
124
  end
125
125
 
126
126
  it 'uses hashed version of self as request body' do
@@ -147,7 +147,7 @@ describe GroupDocs::Questionnaire do
147
147
  it 'accepts access credentials hash' do
148
148
  lambda do
149
149
  subject.update!(:client_id => 'client_id', :private_key => 'private_key')
150
- end.should_not raise_error(ArgumentError)
150
+ end.should_not raise_error()
151
151
  end
152
152
 
153
153
  it 'uses hashed version of self as request body' do
@@ -164,7 +164,7 @@ describe GroupDocs::Questionnaire do
164
164
  it 'accepts access credentials hash' do
165
165
  lambda do
166
166
  subject.remove!(:client_id => 'client_id', :private_key => 'private_key')
167
- end.should_not raise_error(ArgumentError)
167
+ end.should_not raise_error()
168
168
  end
169
169
  end
170
170
 
@@ -176,7 +176,7 @@ describe GroupDocs::Questionnaire do
176
176
  it 'accepts access credentials hash' do
177
177
  lambda do
178
178
  subject.datasources!(:client_id => 'client_id', :private_key => 'private_key')
179
- end.should_not raise_error(ArgumentError)
179
+ end.should_not raise_error()
180
180
  end
181
181
 
182
182
  it 'returns array of GroupDocs::DataSource objects' do
@@ -196,7 +196,7 @@ describe GroupDocs::Questionnaire do
196
196
  it 'accepts access credentials hash' do
197
197
  lambda do
198
198
  subject.executions!(:client_id => 'client_id', :private_key => 'private_key')
199
- end.should_not raise_error(ArgumentError)
199
+ end.should_not raise_error()
200
200
  end
201
201
 
202
202
  it 'returns an array of GroupDocs::Questionnaire::Execution objects' do
@@ -215,8 +215,22 @@ describe GroupDocs::Questionnaire do
215
215
 
216
216
  it 'accepts access credentials hash' do
217
217
  lambda do
218
- subject.collectors!({}, :client_id => 'client_id', :private_key => 'private_key')
219
- end.should_not raise_error(ArgumentError)
218
+ subject.collectors!(%w(options), :client_id => 'client_id', :private_key => 'private_key')
219
+ end.should_not raise_error()
220
+ end
221
+
222
+ it 'accepts options hash' do
223
+ lambda do
224
+ subject.collectors!(:orderBy => '', :isAsc => '')
225
+ end.should_not raise_error()
226
+ end
227
+
228
+ it 'returns an array of GroupDocs::Questionnaire::Collector objects' do
229
+ collectors = subject.collectors!
230
+ collectors.should be_an(Array)
231
+ collectors.each do |collector|
232
+ collector.should be_a(GroupDocs::Questionnaire::Collector)
233
+ end
220
234
  end
221
235
  end
222
236
 
@@ -228,7 +242,7 @@ describe GroupDocs::Questionnaire do
228
242
  it 'accepts access credentials hash' do
229
243
  lambda do
230
244
  subject.metadata!(:client_id => 'client_id', :private_key => 'private_key')
231
- end.should_not raise_error(ArgumentError)
245
+ end.should_not raise_error()
232
246
  end
233
247
 
234
248
  it 'returns GroupDocs::Questionnaire object' do
@@ -246,7 +260,7 @@ describe GroupDocs::Questionnaire do
246
260
  it 'accepts access credentials hash' do
247
261
  lambda do
248
262
  subject.update_metadata!(metadata, :client_id => 'client_id', :private_key => 'private_key')
249
- end.should_not raise_error(ArgumentError)
263
+ end.should_not raise_error()
250
264
  end
251
265
 
252
266
  it 'raises error if metadata is not GroupDocs::Questionnaire object' do
@@ -267,7 +281,7 @@ describe GroupDocs::Questionnaire do
267
281
  it 'accepts access credentials hash' do
268
282
  lambda do
269
283
  subject.fields!(:client_id => 'client_id', :private_key => 'private_key')
270
- end.should_not raise_error(ArgumentError)
284
+ end.should_not raise_error()
271
285
  end
272
286
 
273
287
  it 'returns array of GroupDocs::Document::Field objects' do
@@ -278,48 +292,4 @@ describe GroupDocs::Questionnaire do
278
292
  end
279
293
  end
280
294
  end
281
-
282
- describe '#add_datasource!' do
283
- before(:each) do
284
- mock_api_server(load_json('document_datasource'))
285
- end
286
-
287
- let(:datasource) do
288
- GroupDocs::DataSource.new(:id => 1)
289
- end
290
-
291
- it 'accepts access credentials hash' do
292
- lambda do
293
- subject.datasource!(datasource, {}, :client_id => 'client_id', :private_key => 'private_key')
294
- end.should_not raise_error(ArgumentError)
295
- end
296
-
297
- it 'accepts options hash' do
298
- lambda do
299
- subject.datasource!(datasource, :new_type => :pdf)
300
- end.should_not raise_error(ArgumentError)
301
- end
302
- end
303
-
304
- describe '#add_datasource_fields!' do
305
- before(:each) do
306
- mock_api_server(load_json('document_datasource'))
307
- end
308
-
309
- let(:datasource) do
310
- GroupDocs::DataSource.new(:id => 1)
311
- end
312
-
313
- it 'accepts access credentials hash' do
314
- lambda do
315
- subject.add_datasource_fields!(datasource, {}, :client_id => 'client_id', :private_key => 'private_key')
316
- end.should_not raise_error(ArgumentError)
317
- end
318
-
319
- it 'accepts options hash' do
320
- lambda do
321
- subject.datasource!(datasource, :new_type => :pdf)
322
- end.should_not raise_error(ArgumentError)
323
- end
324
- end
325
295
  end