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
@@ -18,11 +18,11 @@ describe GroupDocs::Signature::Template do
18
18
  it 'accepts access credentials hash' do
19
19
  lambda do
20
20
  described_class.all!({}, :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 'allows passing options' do
25
- lambda { described_class.all!(:page => 1, :count => 3) }.should_not raise_error(ArgumentError)
25
+ lambda { described_class.all!(:page => 1, :count => 3) }.should_not raise_error()
26
26
  end
27
27
 
28
28
  it 'returns array of GroupDocs::Signature::Template objects' do
@@ -50,7 +50,7 @@ describe GroupDocs::Signature::Template do
50
50
  it 'accepts access credentials hash' do
51
51
  lambda do
52
52
  subject.add_recipient!(recipient, :client_id => 'client_id', :private_key => 'private_key')
53
- end.should_not raise_error(ArgumentError)
53
+ end.should_not raise_error()
54
54
  end
55
55
 
56
56
  it 'raises error if recipient is not GroupDocs::Signature::Recipient object' do
@@ -70,7 +70,7 @@ describe GroupDocs::Signature::Template do
70
70
  it 'accepts access credentials hash' do
71
71
  lambda do
72
72
  subject.modify_recipient!(recipient, :client_id => 'client_id', :private_key => 'private_key')
73
- end.should_not raise_error(ArgumentError)
73
+ end.should_not raise_error()
74
74
  end
75
75
 
76
76
  it 'raises error if recipient is not GroupDocs::Signature::Recipient object' do
@@ -12,7 +12,7 @@ describe GroupDocs::Signature do
12
12
  it 'accepts access credentials hash' do
13
13
  lambda do
14
14
  described_class.get!(:client_id => 'client_id', :private_key => 'private_key')
15
- end.should_not raise_error(ArgumentError)
15
+ end.should_not raise_error()
16
16
  end
17
17
 
18
18
  it 'returns array of GroupDocs::Signature objects' do
@@ -34,7 +34,7 @@ describe GroupDocs::Signature do
34
34
  it 'accepts access credentials hash' do
35
35
  lambda do
36
36
  described_class.get_for_recipient!(recipient, :client_id => 'client_id', :private_key => 'private_key')
37
- end.should_not raise_error(ArgumentError)
37
+ end.should_not raise_error()
38
38
  end
39
39
 
40
40
  it 'raises error if recipient is not GroupDocs::Signature::Recipient object' do
@@ -92,7 +92,7 @@ describe GroupDocs::Signature do
92
92
  it 'accepts access credentials hash' do
93
93
  lambda do
94
94
  subject.create!('Signature', :client_id => 'client_id', :private_key => 'private_key')
95
- end.should_not raise_error(ArgumentError)
95
+ end.should_not raise_error()
96
96
  end
97
97
 
98
98
  it 'uses hashed version of self as request body' do
@@ -117,7 +117,7 @@ describe GroupDocs::Signature do
117
117
  it 'accepts access credentials hash' do
118
118
  lambda do
119
119
  subject.create_for_recipient!(recipient, 'Signature', :client_id => 'client_id', :private_key => 'private_key')
120
- end.should_not raise_error(ArgumentError)
120
+ end.should_not raise_error()
121
121
  end
122
122
 
123
123
  it 'raises error if recipient is not GroupDocs::Signature::Recipient object' do
@@ -144,7 +144,7 @@ describe GroupDocs::Signature do
144
144
  it 'accepts access credentials hash' do
145
145
  lambda do
146
146
  subject.delete!(:client_id => 'client_id', :private_key => 'private_key')
147
- end.should_not raise_error(ArgumentError)
147
+ end.should_not raise_error()
148
148
  end
149
149
  end
150
150
 
@@ -156,7 +156,7 @@ describe GroupDocs::Signature do
156
156
  it 'accepts access credentials hash' do
157
157
  lambda do
158
158
  subject.signature_data!(:client_id => 'client_id', :private_key => 'private_key')
159
- end.should_not raise_error(ArgumentError)
159
+ end.should_not raise_error()
160
160
  end
161
161
 
162
162
  it 'returns data' do
@@ -178,7 +178,7 @@ describe GroupDocs::Signature do
178
178
  it 'accepts access credentials hash' do
179
179
  lambda do
180
180
  subject.initials_data!(:client_id => 'client_id', :private_key => 'private_key')
181
- end.should_not raise_error(ArgumentError)
181
+ end.should_not raise_error()
182
182
  end
183
183
 
184
184
  it 'returns data' do
@@ -191,17 +191,4 @@ describe GroupDocs::Signature do
191
191
  end.should change(subject, :initials_data)
192
192
  end
193
193
  end
194
-
195
- describe '#sign_document_status!' do
196
- before(:each) do
197
- mock_api_server(load_json('sign_documents'))
198
- end
199
-
200
- it 'accepts access credentials hash' do
201
- lambda do
202
- subject.initials_data!(:client_id => 'client_id', :private_key => 'private_key')
203
- end.should_not raise_error(ArgumentError)
204
- end
205
- end
206
-
207
194
  end
@@ -13,13 +13,13 @@ describe GroupDocs::Storage::File do
13
13
  it 'accepts access credentials hash' do
14
14
  lambda do
15
15
  described_class.upload!(__FILE__, {}, :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.upload!(__FILE__, :path => 'folder1')
22
- end.should_not raise_error(ArgumentError)
22
+ end.should_not raise_error()
23
23
  end
24
24
 
25
25
  it 'uses root folder by default' do
@@ -45,24 +45,6 @@ describe GroupDocs::Storage::File do
45
45
  end
46
46
  end
47
47
 
48
- describe '.decompress!' do
49
- before(:each) do
50
- mock_api_server(load_json('file_upload'))
51
- end
52
-
53
- it 'accepts access credentials hash' do
54
- lambda do
55
- described_class.decompress!(__FILE__, {}, :client_id => 'client_id', :private_key => 'private_key')
56
- end.should_not raise_error(ArgumentError)
57
- end
58
-
59
- it 'accepts options hash' do
60
- lambda do
61
- described_class.decompress!(__FILE__, :path => 'folder1', :archiveType => 'zip')
62
- end.should_not raise_error(ArgumentError)
63
- end
64
- end
65
-
66
48
  describe '.upload_web!' do
67
49
  before(:each) do
68
50
  mock_api_server(load_json('file_upload'))
@@ -71,7 +53,7 @@ describe GroupDocs::Storage::File do
71
53
  it 'accepts access credentials hash' do
72
54
  lambda do
73
55
  described_class.upload_web!('http://www.google.com', :client_id => 'client_id', :private_key => 'private_key')
74
- end.should_not raise_error(ArgumentError)
56
+ end.should_not raise_error()
75
57
  end
76
58
 
77
59
  it 'returns GroupDocs::Storage::File object' do
@@ -79,22 +61,6 @@ describe GroupDocs::Storage::File do
79
61
  end
80
62
  end
81
63
 
82
- describe '.upload_google!' do
83
- before(:each) do
84
- mock_api_server(load_json('file_upload'))
85
- end
86
-
87
- it 'accepts access credentials hash' do
88
- lambda do
89
- described_class.upload_google!('path', 'http://www.google.com', :client_id => 'client_id', :private_key => 'private_key')
90
- end.should_not raise_error(ArgumentError)
91
- end
92
-
93
- it 'returns GroupDocs::Storage::File object' do
94
- described_class.upload_google!('path', 'http://www.google.com').should be_a(GroupDocs::Storage::File)
95
- end
96
- end
97
-
98
64
  it { should have_accessor(:id) }
99
65
  it { should have_accessor(:guid) }
100
66
  it { should have_accessor(:known) }
@@ -167,37 +133,11 @@ describe GroupDocs::Storage::File do
167
133
  it 'accepts access credentials hash' do
168
134
  lambda do
169
135
  subject.download!(path, :client_id => 'client_id', :private_key => 'private_key')
170
- end.should_not raise_error(ArgumentError)
171
- end
172
-
173
- it 'downloads file to given path' do
174
- file = stub('file')
175
- Object::File.should_receive(:open).with("#{path}/resume.pdf", 'wb').and_yield(file)
176
- file.should_receive(:write).with(File.read('spec/support/files/resume.pdf'))
177
- subject.download!(path)
178
- end
179
-
180
- it 'returns saved file path' do
181
- subject.download!(path).should == "#{path}/resume.pdf"
182
- end
183
- end
184
-
185
- describe '#download!' do
186
- before(:each) do
187
- mock_api_server(File.read('spec/support/files/resume.pdf'))
188
- subject.stub(:name => 'resume.pdf')
189
- end
190
-
191
- let(:path) { Dir.tmpdir }
192
-
193
- it 'accepts access credentials hash' do
194
- lambda do
195
- subject.download!(path, :client_id => 'client_id', :private_key => 'private_key')
196
- end.should_not raise_error(ArgumentError)
136
+ end.should_not raise_error()
197
137
  end
198
138
 
199
139
  it 'downloads file to given path' do
200
- file = stub('file')
140
+ file = double('file')
201
141
  Object::File.should_receive(:open).with("#{path}/resume.pdf", 'wb').and_yield(file)
202
142
  file.should_receive(:write).with(File.read('spec/support/files/resume.pdf'))
203
143
  subject.download!(path)
@@ -216,13 +156,13 @@ describe GroupDocs::Storage::File do
216
156
  it 'accepts access credentials hash' do
217
157
  lambda do
218
158
  subject.move!('folder1', {}, :client_id => 'client_id', :private_key => 'private_key')
219
- end.should_not raise_error(ArgumentError)
159
+ end.should_not raise_error()
220
160
  end
221
161
 
222
162
  it 'accepts options credentials hash' do
223
163
  lambda do
224
164
  subject.move!('folder1', :name => 'file.pdf')
225
- end.should_not raise_error(ArgumentError)
165
+ end.should_not raise_error()
226
166
  end
227
167
 
228
168
  it 'uses current file name by default' do
@@ -248,10 +188,14 @@ describe GroupDocs::Storage::File do
248
188
  subject.path = '/'
249
189
  end
250
190
 
191
+
251
192
  it 'accepts access credentials hash' do
252
193
  lambda do
253
194
  subject.rename!('resume.pdf', :client_id => 'client_id', :private_key => 'private_key')
254
- end.should_not raise_error(ArgumentError)
195
+ end.should_not raise_error()
196
+ end
197
+ before(:each) do
198
+ mock_api_server(load_json('file_move'))
255
199
  end
256
200
 
257
201
  it 'uses #move! to rename file' do
@@ -268,13 +212,13 @@ describe GroupDocs::Storage::File do
268
212
  it 'accepts access credentials hash' do
269
213
  lambda do
270
214
  subject.copy!('resume.pdf', {}, :client_id => 'client_id', :private_key => 'private_key')
271
- end.should_not raise_error(ArgumentError)
215
+ end.should_not raise_error()
272
216
  end
273
217
 
274
218
  it 'accepts options credentials hash' do
275
219
  lambda do
276
220
  subject.copy!('folder1', :name => 'file.pdf')
277
- end.should_not raise_error(ArgumentError)
221
+ end.should_not raise_error()
278
222
  end
279
223
 
280
224
  it 'uses current file name by default' do
@@ -303,7 +247,7 @@ describe GroupDocs::Storage::File do
303
247
  it 'accepts access credentials hash' do
304
248
  lambda do
305
249
  subject.compress!(:client_id => 'client_id', :private_key => 'private_key')
306
- end.should_not raise_error(ArgumentError)
250
+ end.should_not raise_error()
307
251
  end
308
252
 
309
253
  it 'returns archived file' do
@@ -318,10 +262,14 @@ describe GroupDocs::Storage::File do
318
262
  end
319
263
 
320
264
  describe '#delete!' do
265
+ before(:each) do
266
+ mock_api_server(load_json('file_move'))
267
+ end
268
+
321
269
  it 'accepts access credentials hash' do
322
270
  lambda do
323
271
  subject.delete!(:client_id => 'client_id', :private_key => 'private_key')
324
- end.should_not raise_error(ArgumentError)
272
+ end.should_not raise_error()
325
273
  end
326
274
 
327
275
  it 'uses file guid' do
@@ -332,18 +280,14 @@ describe GroupDocs::Storage::File do
332
280
  end
333
281
 
334
282
  describe '#move_to_trash!' do
335
- it 'accepts access credentials hash' do
336
- lambda do
337
- subject.move_to_trash!(:client_id => 'client_id', :private_key => 'private_key')
338
- end.should_not raise_error(ArgumentError)
283
+ before(:each) do
284
+ mock_api_server(load_json('file_move'))
339
285
  end
340
- end
341
286
 
342
- describe '#restore_to_trash!' do
343
287
  it 'accepts access credentials hash' do
344
288
  lambda do
345
- subject.restore_to_trash!('path', :client_id => 'client_id', :private_key => 'private_key')
346
- end.should_not raise_error(ArgumentError)
289
+ subject.move_to_trash!(:client_id => 'client_id', :private_key => 'private_key')
290
+ end.should_not raise_error()
347
291
  end
348
292
  end
349
293
 
@@ -13,7 +13,7 @@ describe GroupDocs::Storage::Folder do
13
13
  it 'accepts access credentials hash' do
14
14
  lambda do
15
15
  described_class.create!('Test', :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::Storage::Folder object' do
@@ -30,19 +30,19 @@ describe GroupDocs::Storage::Folder do
30
30
  it 'accepts access credentials hash' do
31
31
  lambda do
32
32
  described_class.list!('', {}, :client_id => 'client_id', :private_key => 'private_key')
33
- end.should_not raise_error(ArgumentError)
33
+ end.should_not raise_error()
34
34
  end
35
35
 
36
36
  it 'allows passing path' do
37
- lambda { described_class.list!('test') }.should_not raise_error(ArgumentError)
37
+ lambda { described_class.list!('test') }.should_not raise_error()
38
38
  end
39
39
 
40
40
  it 'allows passing options' do
41
- lambda { described_class.list!('', :page => 1, :count => 1) }.should_not raise_error(ArgumentError)
41
+ lambda { described_class.list!('', :page => 1, :count => 1) }.should_not raise_error()
42
42
  end
43
43
 
44
44
  it 'creates new instance of GroupDocs::Storage::Folder and calls #list!' do
45
- folder = stub('folder')
45
+ folder = double('folder')
46
46
  GroupDocs::Storage::Folder.should_receive(:new).with(:path => '').and_return(folder)
47
47
  folder.should_receive(:list!).with({}, {})
48
48
  described_class.list!
@@ -83,11 +83,11 @@ describe GroupDocs::Storage::Folder do
83
83
  it 'accepts access credentials hash' do
84
84
  lambda do
85
85
  subject.list!({}, :client_id => 'client_id', :private_key => 'private_key')
86
- end.should_not raise_error(ArgumentError)
86
+ end.should_not raise_error()
87
87
  end
88
88
 
89
89
  it 'allows passing options' do
90
- lambda { subject.list!(:page => 1, :count => 1) }.should_not raise_error(ArgumentError)
90
+ lambda { subject.list!(:page => 1, :count => 1) }.should_not raise_error()
91
91
  end
92
92
 
93
93
  it 'capitalizes :order_by option' do
@@ -131,7 +131,7 @@ describe GroupDocs::Storage::Folder do
131
131
  it 'accepts access credentials hash' do
132
132
  lambda do
133
133
  subject.move!('Test', :client_id => 'client_id', :private_key => 'private_key')
134
- end.should_not raise_error(ArgumentError)
134
+ end.should_not raise_error()
135
135
  end
136
136
 
137
137
  it 'returns moved to folder path' do
@@ -150,7 +150,7 @@ describe GroupDocs::Storage::Folder do
150
150
  it 'accepts access credentials hash' do
151
151
  lambda do
152
152
  subject.copy!('/Test2', :client_id => 'client_id', :private_key => 'private_key')
153
- end.should_not raise_error(ArgumentError)
153
+ end.should_not raise_error()
154
154
  end
155
155
 
156
156
  it 'returns moved to folder path' do
@@ -168,7 +168,7 @@ describe GroupDocs::Storage::Folder do
168
168
  it 'accepts access credentials hash' do
169
169
  lambda do
170
170
  subject.create!(:client_id => 'client_id', :private_key => 'private_key')
171
- end.should_not raise_error(ArgumentError)
171
+ end.should_not raise_error()
172
172
  end
173
173
 
174
174
  it 'calls create! class method and pass parameters to it' do
@@ -193,7 +193,7 @@ describe GroupDocs::Storage::Folder do
193
193
  it 'accepts access credentials hash' do
194
194
  lambda do
195
195
  subject.delete!(:client_id => 'client_id', :private_key => 'private_key')
196
- end.should_not raise_error(ArgumentError)
196
+ end.should_not raise_error()
197
197
  end
198
198
 
199
199
  it 'determines path by name' do
@@ -210,7 +210,7 @@ describe GroupDocs::Storage::Folder do
210
210
  it 'accepts access credentials hash' do
211
211
  lambda do
212
212
  subject.sharers!(:client_id => 'client_id', :private_key => 'private_key')
213
- end.should_not raise_error(ArgumentError)
213
+ end.should_not raise_error()
214
214
  end
215
215
 
216
216
  it 'returns an array of GroupDocs::User objects' do
@@ -230,7 +230,7 @@ describe GroupDocs::Storage::Folder do
230
230
  it 'accepts access credentials hash' do
231
231
  lambda do
232
232
  subject.sharers_set!(%w(test1@email.com), :client_id => 'client_id', :private_key => 'private_key')
233
- end.should_not raise_error(ArgumentError)
233
+ end.should_not raise_error()
234
234
  end
235
235
 
236
236
  it 'returns an array of GroupDocs::User objects' do
@@ -260,7 +260,7 @@ describe GroupDocs::Storage::Folder do
260
260
  it 'accepts access credentials hash' do
261
261
  lambda do
262
262
  subject.sharers_clear!(:client_id => 'client_id', :private_key => 'private_key')
263
- end.should_not raise_error(ArgumentError)
263
+ end.should_not raise_error()
264
264
  end
265
265
 
266
266
  it 'clears sharers list and returns nil' do
@@ -22,13 +22,13 @@ describe GroupDocs::Storage::Package do
22
22
  describe '#create!' do
23
23
  before(:each) do
24
24
  mock_api_server(load_json('package_create'))
25
- subject.objects = [stub(:name => 'object 1', :path => 'path 1')]
25
+ subject.objects = [double(:name => 'object 1', :path => 'path 1')]
26
26
  end
27
27
 
28
28
  it 'accepts access credentials hash' do
29
29
  lambda do
30
30
  subject.create!(:client_id => 'client_id', :private_key => 'private_key')
31
- end.should_not raise_error(ArgumentError)
31
+ end.should_not raise_error()
32
32
  end
33
33
 
34
34
  it 'returns URL for package downloading' do
@@ -9,7 +9,7 @@ describe GroupDocs::Storage do
9
9
  it 'accepts access credentials hash' do
10
10
  lambda do
11
11
  described_class.info!(:client_id => 'client_id', :private_key => 'private_key')
12
- end.should_not raise_error(ArgumentError)
12
+ end.should_not raise_error()
13
13
  end
14
14
 
15
15
  it 'returns a hash of information' do
@@ -12,7 +12,7 @@ describe GroupDocs::Subscription do
12
12
  it 'accepts access credentials hash' do
13
13
  lambda do
14
14
  described_class.current!(:client_id => 'client_id', :private_key => 'private_key')
15
- end.should_not raise_error(ArgumentError)
15
+ end.should_not raise_error()
16
16
  end
17
17
 
18
18
  it 'returns GroupDocs::Subscription object' do
@@ -27,12 +27,12 @@ describe GroupDocs::Subscription do
27
27
 
28
28
  it 'accepts access credentials hash' do
29
29
  lambda do
30
- described_class.list!(invalidate, :client_id => 'client_id', :private_key => 'private_key')
31
- end.should_not raise_error(ArgumentError)
30
+ described_class.list!('invalidate', :client_id => 'client_id', :private_key => 'private_key')
31
+ end.should_not raise_error()
32
32
  end
33
33
 
34
34
  it 'returns array of GroupDocs::Subscription objects' do
35
- plans = described_class.list! 'invalidate'
35
+ plans = described_class.list!'invalidate'
36
36
  plans.should be_an(Array)
37
37
  plans.each do |plan|
38
38
  plan.should be_a(GroupDocs::Subscription)
@@ -71,123 +71,4 @@ describe GroupDocs::Subscription do
71
71
  end
72
72
  end
73
73
  end
74
-
75
- describe '.invoices!' do
76
- before(:each) do
77
- mock_api_server(load_json('subscription_plan_get'))
78
- end
79
-
80
- it 'accepts access credentials hash' do
81
- lambda do
82
- described_class.invoices!('plan', 'discount',:client_id => 'client_id', :private_key => 'private_key')
83
- end.should_not raise_error(ArgumentError)
84
- end
85
- end
86
-
87
- describe '.subscription!' do
88
- before(:each) do
89
- mock_api_server(load_json('subscription_get'))
90
- end
91
-
92
- it 'accepts access credentials hash' do
93
- lambda do
94
- described_class.subscription!(:client_id => 'client_id', :private_key => 'private_key')
95
- end.should_not raise_error(ArgumentError)
96
- end
97
- end
98
-
99
- describe '.set_subscription!' do
100
- before(:each) do
101
- mock_api_server(load_json('subscription_get'))
102
- end
103
-
104
- it 'accepts access credentials hash' do
105
- lambda do
106
- described_class.set_subscription!(plan, product_id, :client_id => 'client_id', :private_key => 'private_key')
107
- end.should_not raise_error(ArgumentError)
108
- end
109
- end
110
-
111
- describe '.update_subscription!' do
112
- before(:each) do
113
- mock_api_server(load_json('subscription_get'))
114
- end
115
-
116
- it 'accepts access credentials hash' do
117
- lambda do
118
- described_class.update_subscription!(plan, product_id, :client_id => 'client_id', :private_key => 'private_key')
119
- end.should_not raise_error(ArgumentError)
120
- end
121
- end
122
-
123
- describe '.get_countries!' do
124
- before(:each) do
125
- mock_api_server(load_json('subscription_countries_get'))
126
- end
127
-
128
- it 'accepts access credentials hash' do
129
- lambda do
130
- described_class.get_countries!(:client_id => 'client_id', :private_key => 'private_key')
131
- end.should_not raise_error(ArgumentError)
132
- end
133
- end
134
-
135
- describe '.get_states!' do
136
- before(:each) do
137
- mock_api_server(load_json('subscription_states_get'))
138
- end
139
-
140
- it 'accepts access credentials hash' do
141
- lambda do
142
- described_class.get_states!(name, :client_id => 'client_id', :private_key => 'private_key')
143
- end.should_not raise_error(ArgumentError)
144
- end
145
- end
146
-
147
- describe '.set_billing!' do
148
- before(:each) do
149
- mock_api_server(load_json('subscription_billing_set'))
150
- end
151
-
152
- it 'accepts access credentials hash' do
153
- lambda do
154
- described_class.get_states!({}, :client_id => 'client_id', :private_key => 'private_key')
155
- end.should_not raise_error(ArgumentError)
156
- end
157
- end
158
- describe '.get_invoices!' do
159
- before(:each) do
160
- mock_api_server(load_json('subscription_invoices_get'))
161
- end
162
-
163
- it 'accepts access credentials hash' do
164
- lambda do
165
- described_class.get_invoices!({}, :client_id => 'client_id', :private_key => 'private_key')
166
- end.should_not raise_error(ArgumentError)
167
- end
168
- end
169
-
170
- describe '.get_plans!' do
171
- before(:each) do
172
- mock_api_server(load_json('subscription_get_plan'))
173
- end
174
-
175
- it 'accepts access credentials hash' do
176
- lambda do
177
- described_class.get_plans!(:client_id => 'client_id', :private_key => 'private_key')
178
- end.should_not raise_error(ArgumentError)
179
- end
180
- end
181
-
182
- describe '.get_wizard!' do
183
- before(:each) do
184
- mock_api_server(load_json('subscription_wizard_get'))
185
- end
186
-
187
- it 'accepts access credentials hash' do
188
- lambda do
189
- described_class.get_plans!(:client_id => 'client_id', :private_key => 'private_key')
190
- end.should_not raise_error(ArgumentError)
191
- end
192
- end
193
74
  end