teamlab 0.3.10 → 0.3.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -10,37 +10,6 @@ describe Teamlab do
10
10
  end
11
11
  end
12
12
 
13
- shared_examples_for 'an api request' do
14
- before do
15
- @module = Teamlab.send(teamlab_module)
16
- puts "#{command}(#{args.join(', ')})"
17
- @response = args.empty? ? @module.send(command) : @module.send(command, *args)
18
- if add_data_to_collector
19
- DATA_COLLECTOR[data_param] ||= []
20
- DATA_COLLECTOR[data_param] << param_names.inject(@response.body['response']) { |resp, param| resp[param] }
21
- end
22
- end
23
-
24
- context 'Successful api request' do
25
-
26
- it 'returns Teamlab::Response object' do
27
- @response.should be_instance_of(Teamlab::Response)
28
- end
29
-
30
- it 'returns Teamlab::Response object with successful parameter, set to true' do
31
- @response.success.should be_true
32
- end
33
-
34
- it 'returns Teamlab::Response object with nil error parameter' do
35
- @response.error.should be_nil
36
- end
37
-
38
- it 'returns Teamlab::Response object with hash body' do
39
- @response.body.should be_instance_of(Hash)
40
- end
41
- end
42
- end
43
-
44
13
  describe 'Preparing enviroment' do
45
14
  describe '#add_user' do
46
15
  it_should_behave_like 'an api request' do
@@ -107,3522 +76,11 @@ describe Teamlab do
107
76
  end
108
77
  end
109
78
 
110
- describe '[People]' do
111
- let(:teamlab_module) { :people }
112
-
113
- describe '#get_people' do
114
- it_should_behave_like 'an api request' do
115
- let(:command) { :get_people }
116
- end
117
- end
118
-
119
- describe '#get_self' do
120
- it_should_behave_like 'an api request' do
121
- let(:command) { :get_self }
122
- end
123
- end
124
-
125
- describe '#search_people' do
126
- it_should_behave_like 'an api request' do
127
- let(:command) { :search_people }
128
- let(:args) { [random_word(4)] }
129
- end
130
- end
131
-
132
- describe '#filter' do
133
- it_should_behave_like 'an api request' do
134
- let(:command) { :filter_people }
135
- let(:args) { [{ activationStatus: 1 }] }
136
- end
137
- end
138
-
139
- describe '#add_user' do
140
- it_should_behave_like 'an api request' do
141
- let(:command) { :add_user }
142
- let(:args) { [random_bool, random_email, random_word.capitalize, random_word.capitalize] }
143
- let(:add_data_to_collector) { true }
144
- let(:data_param) {:new_user_ids}
145
- let(:param_names) {%w(id)}
146
- end
147
- end
148
-
149
- describe '#get_user_by_username' do
150
- it_should_behave_like 'an api request' do
151
- let(:command) { :get_user_by_username }
152
- let(:args) { [random_id(:new_user)] }
153
- let(:add_data_to_collector) { true }
154
- let(:data_param) {:emails}
155
- let(:param_names) {%w(email)}
156
- end
157
- end
158
-
159
- describe '#get_people_by_status' do
160
- it_should_behave_like 'an api request' do
161
- let(:command) { :get_people_by_status }
162
- let(:args) { [USER_STATUSES.sample] }
163
- end
164
- end
165
-
166
- describe '#get_people_by_search_query' do
167
- it_should_behave_like 'an api request' do
168
- let(:command) { :get_people_by_search_query }
169
- let(:args) { [random_word] }
170
- end
171
- end
172
-
173
- describe '#remind_password' do
174
- it_should_behave_like 'an api request' do
175
- let(:command) { :remind_password }
176
- let(:args) { [DATA_COLLECTOR[:new_user_ids].first, DATA_COLLECTOR[:emails].pop] }
177
- end
178
- end
179
-
180
- describe '#search_with_status' do
181
- it_should_behave_like 'an api request' do
182
- let(:command) { :search_with_status }
183
- let(:args) { [USER_STATUSES.sample.downcase, random_word] }
184
- end
185
- end
186
-
187
- describe '#update_contacts' do
188
- it_should_behave_like 'an api request' do
189
- let(:command) { :update_contacts }
190
- let(:args) { [random_id(:new_user), USER_CONTACTS] }
191
- end
192
- end
193
-
194
- describe '#send_invite' do
195
- it_should_behave_like 'an api request' do
196
- let(:command) { :send_invite }
197
- let(:args) { [DATA_COLLECTOR[:new_user_ids]] }
198
- end
199
- end
200
-
201
- describe '#delete' do
202
- it_should_behave_like 'an api request' do
203
- let(:command) { :delete }
204
- let(:args) { [[]] }
205
- end
206
- end
207
-
208
- describe '#update_user' do
209
- it_should_behave_like 'an api request' do
210
- let(:command) { :update_user }
211
- let(:args) { [random_id(:new_user), random_bool, random_email, random_word, random_word, { comment: random_word}] }
212
- end
213
- end
214
-
215
- describe '#change_people_type' do
216
- it_should_behave_like 'an api request' do
217
- let(:command) { :change_people_type }
218
- let(:args) { [USER_TYPES.sample, DATA_COLLECTOR[:new_user_ids]] }
219
- end
220
- end
221
-
222
- describe '#update_photo' do
223
- it_should_behave_like 'an api request' do
224
- pending 'http://bugzserver/show_bug.cgi?id=23867'
225
- let(:command) { :update_photo }
226
- let(:args) { [random_id(:new_user), PATH_TO_IMAGE] }
227
- end
228
- end
229
-
230
- describe '#change_people_status' do
231
- it_should_behave_like 'an api request' do
232
- let(:command) { :change_people_status }
233
- let(:args) { [ USER_STATUSES.sample, DATA_COLLECTOR[:new_user_ids]] }
234
- end
235
- end
236
-
237
- describe '#add_contacts' do
238
- it_should_behave_like 'an api request' do
239
- let(:command) { :add_contacts }
240
- let(:args) { [ USER_CONTACTS, random_id(:new_user)] }
241
- end
242
- end
243
-
244
- describe '#delete_photo' do
245
- it_should_behave_like 'an api request' do
246
- let(:command) { :delete_photo }
247
- let(:args) { [random_id(:new_user)] }
248
- end
249
- end
250
-
251
- describe '#delete_contacts' do
252
- it_should_behave_like 'an api request' do
253
- let(:command) { :delete_contacts }
254
- let(:args) { [random_id(:new_user), USER_CONTACTS] }
255
- end
256
- end
257
-
258
- describe '#delete_user' do
259
- it_should_behave_like 'an api request' do
260
- let(:command) { :delete_user }
261
- let(:args) { [DATA_COLLECTOR[:new_user_ids].pop] }
262
- end
263
- end
264
- end
265
-
266
- describe '[Group]' do
267
-
268
- let(:teamlab_module) { :group }
269
-
270
- describe '#get_groups' do
271
- it_should_behave_like 'an api request' do
272
- let(:command) { :get_groups }
273
- end
274
- end
275
-
276
- describe '#add_group' do
277
- it_should_behave_like 'an api request' do
278
- let(:command) { :add_group }
279
- let(:args) { [random_id(:user), random_word, DATA_COLLECTOR[:user_ids]] }
280
- let(:add_data_to_collector) { true }
281
- let(:data_param) {:group_ids}
282
- let(:param_names) {%w(id)}
283
- end
284
- end
285
-
286
- describe '#get_group' do
287
- it_should_behave_like 'an api request' do
288
- let(:command) { :get_group }
289
- let(:args) { [random_id(:group)] }
290
- end
291
- end
292
-
293
- describe '#replace_members' do
294
- it_should_behave_like 'an api request' do
295
- let(:command) { :replace_members }
296
- let(:args) { [random_id(:group), DATA_COLLECTOR[:user_ids]] }
297
- end
298
- end
299
-
300
- describe '#update_group' do
301
- it_should_behave_like 'an api request' do
302
- let(:command) { :update_group }
303
- let(:args) { [random_id(:group), { groupManager: random_id(:user), groupName: random_word, members: DATA_COLLECTOR[:user_ids] }] }
304
- end
305
- end
306
-
307
- describe '#add_group_users' do
308
- it_should_behave_like 'an api request' do
309
- let(:command) { :add_group_users }
310
- let(:args) { [random_id(:group), DATA_COLLECTOR[:user_ids]] }
311
- end
312
- end
313
-
314
- describe '#set_group_manager' do
315
- it_should_behave_like 'an api request' do
316
- let(:command) { :set_group_manager }
317
- let(:args) { [random_id(:group), random_id(:user)] }
318
- end
319
- end
320
-
321
- describe '#move_group_members' do
322
- it_should_behave_like 'an api request' do
323
- let(:command) { :move_group_members }
324
- let(:args) { [random_id(:group), random_id(:group)] }
325
- end
326
- end
327
-
328
- describe '#remove_group_members' do
329
- it_should_behave_like 'an api request' do
330
- let(:command) { :remove_group_members }
331
- let(:args) { [random_id(:group)] }
332
- end
333
- end
334
-
335
- describe '#delete_group' do
336
- it_should_behave_like 'an api request' do
337
- let(:command) { :delete_group }
338
- let(:args) { [DATA_COLLECTOR[:group_ids].pop] }
339
- end
340
- end
341
- end
342
-
343
- describe '[Settings]' do
344
-
345
- let(:teamlab_module) { :settings }
346
-
347
- describe '#get_settings' do
348
- it_should_behave_like 'an api request' do
349
- let(:command) { :get_settings }
350
- end
351
- end
352
-
353
- describe '#get_logo' do
354
- it_should_behave_like 'an api request' do
355
- let(:command) { :get_logo }
356
- end
357
- end
358
-
359
- describe '#get_usage_quota' do
360
- it_should_behave_like 'an api request' do
361
- pending 'http://bugzserver/show_bug.cgi?id=23868'
362
- let(:command) { :get_usage_quota }
363
- end
364
- end
365
-
366
- describe '#get_version' do
367
- it_should_behave_like 'an api request' do
368
- let(:command) { :get_version }
369
- end
370
- end
371
-
372
- describe '#get_security' do
373
- it_should_behave_like 'an api request' do
374
- let(:command) { :get_security }
375
- let(:args) { [random_settings_entity_id] }
376
- end
377
- end
378
-
379
- describe '#get_admin_security' do
380
- it_should_behave_like 'an api request' do
381
- let(:command) { :get_admin_security }
382
- let(:args) { [random_settings_entity_id, random_id(:user)] }
383
- end
384
- end
385
-
386
- describe '#get_product_admin' do
387
- it_should_behave_like 'an api request' do
388
- let(:command) { :get_product_admin }
389
- let(:args) { [random_settings_entity_id] }
390
- end
391
- end
392
-
393
- describe '#set_version' do
394
- it_should_behave_like 'an api request' do
395
- let(:command) { :set_version }
396
- let(:args) { [rand(2..50)] }
397
- end
398
- end
399
-
400
- describe '#set_security' do
401
- it_should_behave_like 'an api request' do
402
- let(:command) { :set_security }
403
- let(:args) { [random_settings_entity_id, {enabled: random_bool}] }
404
- end
405
- end
406
-
407
- describe '#set_access' do
408
- it_should_behave_like 'an api request' do
409
- pending 'http://bugzserver/show_bug.cgi?id=23764'
410
- let(:command) { :set_access }
411
- let(:args) { [[random_settings_entity_id, random_bool]] }
412
- end
413
- end
414
-
415
- describe '#set_product_admin' do
416
- it_should_behave_like 'an api request' do
417
- let(:command) { :set_product_admin }
418
- let(:args) { [random_settings_entity_id, random_id(:user)] }
419
- end
420
- end
421
- end
422
-
423
- describe '[Files]' do
424
-
425
- let(:teamlab_module) { :files }
426
-
427
- describe '#get_my_files' do
428
- it_should_behave_like 'an api request' do
429
- let(:command) { :get_my_files }
430
- #let(:add_data_to_collector) { true }
431
- #let(:data_param) {:my_documents_ids}
432
- #let(:param_names) {%w(current id)}
433
- end
434
- end
435
-
436
- describe '#get_trash' do
437
- it_should_behave_like 'an api request' do
438
- let(:command) { :get_trash }
439
- let(:add_data_to_collector) { true }
440
- let(:data_param) {:trash_documents_ids}
441
- let(:param_names) {%w(current id)}
442
- end
443
- end
444
-
445
- describe '#get_shared_docs' do
446
- it_should_behave_like 'an api request' do
447
- let(:command) { :get_shared_docs }
448
- let(:add_data_to_collector) { true }
449
- let(:data_param) {:shared_documents_ids}
450
- let(:param_names) {%w(current id)}
451
- end
452
- end
453
-
454
- describe '#get_common_docs' do
455
- it_should_behave_like 'an api request' do
456
- let(:command) { :get_common_docs }
457
- let(:add_data_to_collector) { true }
458
- let(:data_param) {:common_documents_ids}
459
- let(:param_names) {%w(current id)}
460
- end
461
- end
462
-
463
- describe '#new_folder' do
464
- it_should_behave_like 'an api request' do
465
- let(:command) { :new_folder }
466
- let(:args) { [random_id(:my_documents), random_word] }
467
- let(:add_data_to_collector) { true }
468
- let(:data_param) {:new_folder_ids}
469
- let(:param_names) {%w(current id)}
470
- end
471
- end
472
-
473
- describe '#get_folder' do
474
- it_should_behave_like 'an api request' do
475
- let(:command) { :get_folder }
476
- let(:args) { [random_id(:new_folder)] }
477
- end
478
- end
479
-
480
- describe '#rename_folder' do
481
- it_should_behave_like 'an api request' do
482
- let(:command) { :rename_folder }
483
- let(:args) { [random_id(:new_folder), random_word] }
484
- end
485
- end
486
-
487
- describe '#search' do
488
- it_should_behave_like 'an api request' do
489
- let(:command) { :search }
490
- let(:args) { [random_word] }
491
- end
492
- end
493
-
494
- describe '#get_recent_uploaded_files' do
495
- it_should_behave_like 'an api request' do
496
- pending 'http://bugzserver/show_bug.cgi?id=23869'
497
- let(:command) { :get_recent_uploaded_files }
498
- let(:args) { [random_id(:my_documents)] }
499
- end
500
- end
501
-
502
- describe '#create_file' do
503
- it_should_behave_like 'an api request' do
504
- let(:command) { :create_file }
505
- let(:args) { [random_id(:new_folder), random_word] }
506
- let(:add_data_to_collector) { true }
507
- let(:data_param) {:new_file_ids}
508
- let(:param_names) {%w(id)}
509
- end
510
- end
511
79
 
512
- describe '#generate_shared_link' do
513
- it_should_behave_like 'an api request' do
514
- let(:command) { :generate_shared_link }
515
- let(:args) { [random_id(:new_file), FILES_SHARE_TYPES.sample] }
516
- end
517
- end
518
80
 
519
- describe '#upload_to_my_docs' do
520
- it_should_behave_like 'an api request' do
521
- let(:command) { :upload_to_my_docs }
522
- let(:args) { FILES_FOR_UPLOAD.sample }
523
- end
524
- end
81
+ describe 'Cleaning enviroment' do
525
82
 
526
- describe '#upload_to_common_docs' do
527
- it_should_behave_like 'an api request' do
528
- let(:command) { :upload_to_common_docs }
529
- let(:args) { FILES_FOR_UPLOAD.sample }
530
- end
531
- end
532
-
533
- describe '#upload_to_folder' do
534
- it_should_behave_like 'an api request' do
535
- let(:command) { :upload_to_folder }
536
- let(:args) { [random_id(:new_folder), FILES_FOR_UPLOAD.sample] }
537
- end
538
- end
539
-
540
- describe '#chunked_upload' do
541
- it_should_behave_like 'an api request' do
542
- let(:command) { :chunked_upload }
543
- let(:args) { [random_id(:new_folder), File.basename(FILES_FOR_UPLOAD.sample), rand(1..50)] }
544
- end
545
- end
546
-
547
- describe '#create_txt_in_my_docs' do
548
- it_should_behave_like 'an api request' do
549
- let(:command) { :create_txt_in_my_docs }
550
- let(:args) { [random_word, random_word(rand(100))] }
551
- end
552
- end
553
-
554
- describe '#create_html_in_my_docs' do
555
- it_should_behave_like 'an api request' do
556
- let(:command) { :create_html_in_my_docs }
557
- let(:args) { [random_word, random_word(rand(100))] }
558
- end
559
- end
560
-
561
- describe '#create_txt_in_common_docs' do
562
- it_should_behave_like 'an api request' do
563
- let(:command) { :create_txt_in_common_docs }
564
- let(:args) { [random_word, random_word(rand(100))] }
565
- end
566
- end
567
-
568
- describe '#create_html_in_common_docs' do
569
- it_should_behave_like 'an api request' do
570
- let(:command) { :create_html_in_common_docs }
571
- let(:args) { [random_word, random_word(rand(100))] }
572
- end
573
- end
574
-
575
- describe '#create_txt' do
576
- it_should_behave_like 'an api request' do
577
- let(:command) { :create_txt }
578
- let(:args) { [random_id(:new_folder), random_word, random_word(rand(100))] }
579
- end
580
- end
581
-
582
- describe '#create_html' do
583
- it_should_behave_like 'an api request' do
584
- let(:command) { :create_html }
585
- let(:args) { [random_id(:new_folder), random_word, random_word(rand(100))] }
586
- end
587
- end
588
-
589
- describe '#get_file_info' do
590
- it_should_behave_like 'an api request' do
591
- let(:command) { :get_file_info }
592
- let(:args) { [random_id(:new_file)] }
593
- end
594
- end
595
-
596
- describe '#get_file_history' do
597
- it_should_behave_like 'an api request' do
598
- let(:command) { :get_file_history }
599
- let(:args) { [random_id(:new_file)] }
600
- end
601
- end
602
-
603
- describe '#get_third_party_files' do
604
- it_should_behave_like 'an api request' do
605
- let(:command) { :get_third_party_files }
606
- let(:args) { [THIRD_PARTY_SERVICE, THIRD_PARTY_LOGIN_DATA] }
607
- end
608
- end
609
-
610
- describe '#update_file_info' do
611
- it_should_behave_like 'an api request' do
612
- let(:command) { :update_file_info }
613
- let(:args) { [random_id(:new_file), random_word, 1] }
614
- end
615
- end
616
-
617
- describe '#finish_importing' do
618
- it_should_behave_like 'an api request' do
619
- let(:command) { :finish_importing }
620
- end
621
- end
622
-
623
- describe '#import_from_third_party' do
624
- it_should_behave_like 'an api request' do
625
- let(:command) { :import_from_third_party }
626
- let(:args) { [THIRD_PARTY_SERVICE, THIRD_PARTY_FOLDER_ID, random_bool, [], THIRD_PARTY_LOGIN_DATA] }
627
- end
628
- end
629
-
630
- describe '#get_file_operations_list' do
631
- it_should_behave_like 'an api request' do
632
- let(:command) { :get_file_operations_list }
633
- end
634
- end
635
-
636
- describe '#move_files' do
637
- it_should_behave_like 'an api request' do
638
- let(:command) { :move_files }
639
- let(:args) { [random_id(:new_folder), { fileids: DATA_COLLECTOR[:new_file_ids].sample(rand(1..4)), overwrite: random_bool}] }
640
- end
641
- end
642
-
643
- describe '#copy_to_folder' do
644
- it_should_behave_like 'an api request' do
645
- let(:command) { :copy_to_folder }
646
- let(:args) { [random_id(:new_folder), { fileids: DATA_COLLECTOR[:new_file_ids].sample(rand(1..4)), overwrite: random_bool}] }
647
- end
648
- end
649
-
650
- describe '#delete' do
651
- it_should_behave_like 'an api request' do
652
- let(:command) { :delete }
653
- let(:args) { [ folderIds: [], fileids: [] ] }
654
- end
655
- end
656
-
657
- describe '#finish_all' do
658
- it_should_behave_like 'an api request' do
659
- let(:command) { :finish_all }
660
- end
661
- end
662
-
663
- describe '#mark_as_read' do
664
- it_should_behave_like 'an api request' do
665
- let(:command) { :mark_as_read }
666
- end
667
- end
668
-
669
- describe '#finish_operations' do
670
- it_should_behave_like 'an api request' do
671
- let(:command) { :finish_operations }
672
- let(:args) { [ folderIds: [random_id(:new_folder)], fileids: [random_id(:new_file)] ] }
673
- end
674
- end
675
-
676
- describe '#get_file_sharing' do
677
- it_should_behave_like 'an api request' do
678
- let(:command) { :get_file_sharing }
679
- let(:args) { [random_id(:new_file)] }
680
- end
681
- end
682
-
683
- describe '#get_folder_sharing' do
684
- it_should_behave_like 'an api request' do
685
- let(:command) { :get_folder_sharing }
686
- let(:args) { [random_id(:new_folder)] }
687
- end
688
- end
689
-
690
- describe '#share_file' do
691
- it_should_behave_like 'an api request' do
692
- let(:command) { :share_file }
693
- let(:args) { [random_id(:new_file), random_id(:user), 1, { notify: random_bool, sharingMessage: random_word }] }
694
- end
695
- end
696
-
697
- describe '#share_folder' do
698
- it_should_behave_like 'an api request' do
699
- let(:command) { :share_folder }
700
- let(:args) { [random_id(:new_folder), random_id(:user), 1, { notify: random_bool, sharingMessage: random_word }] }
701
- end
702
- end
703
-
704
- describe '#remove_file_sharing_rights' do
705
- it_should_behave_like 'an api request' do
706
- let(:command) { :remove_file_sharing_rights }
707
- let(:args) { [ random_id(:new_file), [random_id(:user)] ] }
708
- end
709
- end
710
-
711
- describe '#remove_folder_sharing_rights' do
712
- it_should_behave_like 'an api request' do
713
- let(:command) { :remove_folder_sharing_rights }
714
- let(:args) { [ random_id(:new_folder), [random_id(:user)] ] }
715
- end
716
- end
717
-
718
- describe '#get_third_party' do
719
- it_should_behave_like 'an api request' do
720
- let(:command) { :get_third_party }
721
- end
722
- end
723
-
724
- describe '#remove_third_party_account' do
725
- it_should_behave_like 'an api request' do
726
- let(:command) { :remove_third_party_account }
727
- let(:args) { PROVIDER_ID }
728
- end
729
- end
730
-
731
- describe '#delete_file' do
732
- it_should_behave_like 'an api request' do
733
- let(:command) { :delete_file }
734
- let(:args) { [DATA_COLLECTOR[:new_file_ids].pop] }
735
- end
736
- end
737
-
738
- describe '#delete_folder' do
739
- it_should_behave_like 'an api request' do
740
- let(:command) { :delete_folder }
741
- let(:args) { [DATA_COLLECTOR[:new_folder_ids].pop] }
742
- end
743
- end
744
-
745
- describe '#clear_recycle_bin' do
746
- it_should_behave_like 'an api request' do
747
- let(:command) { :clear_recycle_bin }
748
- end
749
- end
750
- end
751
-
752
- describe '[Project]' do
753
-
754
- let(:teamlab_module) { :project }
755
-
756
- describe '#add_importing_url_to_queue' do
757
- it_should_behave_like 'an api request' do
758
- let(:command) { :add_importing_url_to_queue }
759
- let(:args) { [BASECAMP_URL, BASECAMP_LOGIN, BASECAMP_PSW, IMPORT_CLOSED_PROJECTS, DISABLE_NOTIFICATONS, IMPORT_USERS_AS_COLLABORATORS] }
760
- end
761
- end
762
-
763
- describe '#get_projects_for_import' do
764
- it_should_behave_like 'an api request' do
765
- let(:command) { :get_projects_for_import }
766
- let(:args) { [BASECAMP_URL, BASECAMP_LOGIN, BASECAMP_PSW] }
767
- end
768
- end
769
-
770
- describe '#get_import_status' do
771
- it_should_behave_like 'an api request' do
772
- let(:command) { :get_import_status }
773
- end
774
- end
775
-
776
- describe '#create_project' do
777
- it_should_behave_like 'an api request' do
778
- let(:command) { :create_project }
779
- let(:args) { [random_word, random_word, random_id(:user), random_word(3), random_bool, {participants: DATA_COLLECTOR[:user_ids]}] }
780
- let(:add_data_to_collector) { true }
781
- let(:data_param) { :new_project_ids }
782
- let(:param_names) { %w(id) }
783
- end
784
- end
785
-
786
- describe '#add_message' do
787
- it_should_behave_like 'an api request' do
788
- let(:command) { :add_message }
789
- let(:args) { [random_id(:new_project), random_word, random_word, DATA_COLLECTOR[:user_ids].join(',')] }
790
- let(:add_data_to_collector) { true }
791
- let(:data_param) { :discussion_ids }
792
- let(:param_names) { %w(id) }
793
- end
794
- end
795
-
796
- describe '#create_template' do
797
- it_should_behave_like 'an api request' do
798
- let(:command) { :create_template }
799
- let(:args) { [random_word] }
800
- let(:add_data_to_collector) { true }
801
- let(:data_param) { :project_template_ids }
802
- let(:param_names) { %w(id) }
803
- end
804
- end
805
-
806
- describe '#add_task' do
807
- it_should_behave_like 'an api request' do
808
- let(:command) { :add_task }
809
- let(:args) { [random_id(:new_project), random_word] }
810
- let(:add_data_to_collector) { true }
811
- let(:data_param) { :project_task_ids }
812
- let(:param_names) { %w(id) }
813
- end
814
- end
815
-
816
- describe '#add_task_from_discussion' do
817
- it_should_behave_like 'an api request' do
818
- let(:command) { :add_task_from_discussion }
819
- let(:args) { [random_id(:new_project), random_id(:discussion)] }
820
- end
821
- end
822
-
823
- describe '#create_subtask' do
824
- it_should_behave_like 'an api request' do
825
- let(:command) { :create_subtask }
826
- let(:args) { [DATA_COLLECTOR[:project_task_ids].last, random_id(:user), random_word] }
827
- let(:add_data_to_collector) { true }
828
- let(:data_param) { :project_subtask_ids }
829
- let(:param_names) { %w(id) }
830
- end
831
- end
832
-
833
- describe '#add_task_time' do
834
- it_should_behave_like 'an api request' do
835
- let(:command) { :add_task_time }
836
- let(:args) { [random_id(:project_task), Time.now.strftime('%Y-%m-%-d'), random_id(:user), DATA_COLLECTOR[:new_project_ids].last] }
837
- let(:add_data_to_collector) { true }
838
- let(:data_param) { :project_task_time_ids }
839
- let(:param_names) { %w(id) }
840
- end
841
- end
842
-
843
- describe '#upload_file_to_task' do
844
- it_should_behave_like 'an api request' do
845
- let(:command) { :upload_file_to_task }
846
- let(:args) { [random_id(:project_task), [random_id(:file)]] }
847
- end
848
- end
849
-
850
- describe '#upload_file_to_message' do
851
- it_should_behave_like 'an api request' do
852
- let(:command) { :upload_file_to_message }
853
- let(:args) { [random_id(:discussion), [random_id(:file)]] }
854
- end
855
- end
856
-
857
- describe '#add_milestone' do
858
- it_should_behave_like 'an api request' do
859
- let(:command) { :add_milestone }
860
- let(:args) { [random_id(:new_project), random_word, DateTime.commercial(2015).to_s, random_id(:user)] }
861
- let(:add_data_to_collector) { true }
862
- let(:data_param) { :project_milestone_ids }
863
- let(:param_names) { %w(id) }
864
- end
865
- end
866
-
867
- describe '#add_task_comment' do
868
- it_should_behave_like 'an api request' do
869
- let(:command) { :add_task_comment }
870
- let(:args) { [random_id(:project_task), random_word] }
871
- let(:add_data_to_collector) { true }
872
- let(:data_param) { :comment_ids }
873
- let(:param_names) { %w(id) }
874
- end
875
- end
876
-
877
- describe '#add_message_comment' do
878
- it_should_behave_like 'an api request' do
879
- let(:command) { :add_message_comment }
880
- let(:args) { [random_id(:project_task), random_word] }
881
- let(:add_data_to_collector) { true }
882
- let(:data_param) { :comment_ids }
883
- let(:param_names) { %w(id) }
884
- end
885
- end
886
-
887
- describe '#get_latest_discussion_messages' do
888
- it_should_behave_like 'an api request' do
889
- let(:command) { :get_latest_discussion_messages }
890
- end
891
- end
892
-
893
- describe '#get_message_by_filter' do
894
- it_should_behave_like 'an api request' do
895
- let(:command) { :get_message_by_filter }
896
- let(:args) { [{projectId: random_id(:new_project)}] }
897
- end
898
- end
899
-
900
- describe '#get_messages' do
901
- it_should_behave_like 'an api request' do
902
- let(:command) { :get_messages }
903
- let(:args) { [random_id(:new_project)] }
904
- end
905
- end
906
-
907
- describe '#check_subscription_to_discussion' do
908
- it_should_behave_like 'an api request' do
909
- let(:command) { :check_subscription_to_discussion }
910
- let(:args) { [random_id(:discussion)] }
911
- end
912
- end
913
-
914
- describe '#update_message' do
915
- it_should_behave_like 'an api request' do
916
- let(:command) { :update_message }
917
- let(:args) { [random_id(:discussion), random_id(:new_project), random_word, random_word] }
918
- end
919
- end
920
-
921
- describe '#subscribe_to_message_action' do
922
- it_should_behave_like 'an api request' do
923
- let(:command) { :subscribe_to_message_action }
924
- let(:args) { [random_id(:discussion)] }
925
- end
926
- end
927
-
928
- describe '#get_task_files' do
929
- it_should_behave_like 'an api request' do
930
- let(:command) { :get_task_files }
931
- let(:args) { [random_id(:project_task)] }
932
- end
933
- end
934
-
935
- describe '#get_entity_files' do
936
- it_should_behave_like 'an api request' do
937
- let(:command) { :get_entity_files }
938
- let(:args) { [random_id(:project_task), 'Task'] }
939
- end
940
- end
941
-
942
- describe '#get_message_files' do
943
- it_should_behave_like 'an api request' do
944
- let(:command) { :get_message_files }
945
- let(:args) { [random_id(:discussion)] }
946
- end
947
- end
948
-
949
- describe '#get_comment' do
950
- it_should_behave_like 'an api request' do
951
- let(:command) { :get_comment }
952
- let(:args) { [random_id(:comment)] }
953
- end
954
- end
955
-
956
- describe '#get_task_comments' do
957
- it_should_behave_like 'an api request' do
958
- let(:command) { :get_task_comments }
959
- let(:args) { [random_id(:project_task)] }
960
- end
961
- end
962
-
963
- describe '#get_message_comments' do
964
- it_should_behave_like 'an api request' do
965
- let(:command) { :get_message_comments }
966
- let(:args) { [random_id(:discussion)] }
967
- end
968
- end
969
-
970
- describe '#update_comment' do
971
- it_should_behave_like 'an api request' do
972
- let(:command) { :update_comment }
973
- let(:args) { [random_id(:comment), random_word] }
974
- end
975
- end
976
-
977
- describe '#create_report_template' do
978
- it_should_behave_like 'an api request' do
979
- let(:command) { :create_report_template }
980
- let(:args) { [random_word] }
981
- let(:add_data_to_collector) { true }
982
- let(:data_param) { :report_template_ids }
983
- let(:param_names) { %w(id) }
984
- end
985
- end
986
-
987
- describe '#update_report_template' do
988
- it_should_behave_like 'an api request' do
989
- let(:command) { :update_report_template }
990
- let(:args) { [random_id(:report_template), random_word] }
991
- end
992
- end
993
-
994
- describe '#delete_report_template' do
995
- it_should_behave_like 'an api request' do
996
- let(:command) { :delete_report_template }
997
- let(:args) { [DATA_COLLECTOR[:report_template_ids].pop] }
998
- end
999
- end
1000
-
1001
- describe '#get_projects' do
1002
- it_should_behave_like 'an api request' do
1003
- let(:command) { :get_projects }
1004
- end
1005
- end
1006
-
1007
- describe '#get_project' do
1008
- it_should_behave_like 'an api request' do
1009
- let(:command) { :get_project }
1010
- let(:args) { [random_id(:new_project)] }
1011
- end
1012
- end
1013
-
1014
- describe '#get_participated_projects' do
1015
- it_should_behave_like 'an api request' do
1016
- let(:command) { :get_participated_projects }
1017
- end
1018
- end
1019
-
1020
- describe '#filter_projects' do
1021
- it_should_behave_like 'an api request' do
1022
- let(:command) { :filter_projects }
1023
- end
1024
- end
1025
-
1026
- describe '#get_followed_projects' do
1027
- it_should_behave_like 'an api request' do
1028
- let(:command) { :get_followed_projects }
1029
- end
1030
- end
1031
-
1032
- describe '#get_project_by_status' do
1033
- it_should_behave_like 'an api request' do
1034
- let(:command) { :get_project_by_status }
1035
- let(:args) { [PROJECT_STATUSES.sample] }
1036
- end
1037
- end
1038
-
1039
- describe '#get_templates' do
1040
- it_should_behave_like 'an api request' do
1041
- let(:command) { :get_templates }
1042
- end
1043
- end
1044
-
1045
- describe '#get_spent_time' do
1046
- it_should_behave_like 'an api request' do
1047
- let(:command) { :get_spent_time }
1048
- let(:args) { [random_id(:new_project)] }
1049
- end
1050
- end
1051
-
1052
- describe '#get_project_files' do
1053
- it_should_behave_like 'an api request' do
1054
- let(:command) { :get_project_files }
1055
- let(:args) { [random_id(:new_project)] }
1056
- end
1057
- end
1058
-
1059
- describe '#get_template' do
1060
- it_should_behave_like 'an api request' do
1061
- pending 'http://bugzserver/show_bug.cgi?id=23875'
1062
- let(:command) { :get_template }
1063
- let(:args) { [random_id(:project_template)] }
1064
- end
1065
- end
1066
-
1067
- describe '#get_milestones' do
1068
- it_should_behave_like 'an api request' do
1069
- let(:command) { :get_milestones }
1070
- let(:args) { [random_id(:new_project)] }
1071
- end
1072
- end
1073
-
1074
- describe '#search_all_projects' do
1075
- it_should_behave_like 'an api request' do
1076
- let(:command) { :search_all_projects }
1077
- let(:args) { [random_word] }
1078
- end
1079
- end
1080
-
1081
- describe '#search_project' do
1082
- it_should_behave_like 'an api request' do
1083
- let(:command) { :search_project }
1084
- let(:args) { [random_id(:new_project), random_word] }
1085
- end
1086
- end
1087
-
1088
- describe '#get_milestones_with_status' do
1089
- it_should_behave_like 'an api request' do
1090
- let(:command) { :get_milestones_with_status }
1091
- let(:args) { [random_id(:new_project), PROJECT_MILESTONE_STATUSES.sample] }
1092
- end
1093
- end
1094
-
1095
- describe '#update_project_tags' do
1096
- it_should_behave_like 'an api request' do
1097
- let(:command) { :update_project_tags }
1098
- let(:args) { [random_id(:new_project), random_word(3)] }
1099
- end
1100
- end
1101
-
1102
- describe '#update_project_status' do
1103
- it_should_behave_like 'an api request' do
1104
- let(:command) { :update_project_status }
1105
- let(:args) { [random_id(:new_project), PROJECT_STATUSES.sample] }
1106
- end
1107
- end
1108
-
1109
- describe '#update_template' do
1110
- it_should_behave_like 'an api request' do
1111
- let(:command) { :update_template }
1112
- let(:args) { [random_id(:project_template), random_word] }
1113
- end
1114
- end
1115
-
1116
- describe '#follow_unfollow_project' do
1117
- it_should_behave_like 'an api request' do
1118
- let(:command) { :follow_unfollow_project }
1119
- let(:args) { [random_id(:new_project)] }
1120
- end
1121
- end
1122
-
1123
- describe '#get_tasks_by_ids' do
1124
- it_should_behave_like 'an api request' do
1125
- let(:command) { :get_tasks_by_ids }
1126
- let(:args) { [DATA_COLLECTOR[:project_task_ids].sample(rand(2..4))] }
1127
- end
1128
- end
1129
-
1130
- describe '#get_task_order' do
1131
- it_should_behave_like 'an api request' do
1132
- let(:command) { :get_task_order }
1133
- let(:args) { [random_id(:new_project)] }
1134
- end
1135
- end
1136
-
1137
- describe '#get_simple_task_by_filter' do
1138
- it_should_behave_like 'an api request' do
1139
- let(:command) { :get_simple_task_by_filter }
1140
- let(:args) { [random_id(:new_project)] }
1141
- end
1142
- end
1143
-
1144
- describe '#add_link' do
1145
- it_should_behave_like 'an api request' do
1146
- pending 'http://bugzserver/show_bug.cgi?id=23861'
1147
- let(:command) { :add_link }
1148
- let(:args) { [random_id(:project_task), random_id(:project_task), PROJECT_TASK_LINK_TYPES.sample] }
1149
- end
1150
- end
1151
-
1152
- describe '#update_project' do
1153
- it_should_behave_like 'an api request' do
1154
- let(:command) { :update_project }
1155
- let(:args) { [random_id(:new_project), random_word, random_id(:user), {private: random_bool, notify: random_bool}] }
1156
- end
1157
- end
1158
-
1159
- describe '#set_task_order' do
1160
- it_should_behave_like 'an api request' do
1161
- let(:command) { :set_task_order }
1162
- let(:args) { [random_id(:new_project), '123456'] }
1163
- end
1164
- end
1165
-
1166
- describe '#update_project_task' do
1167
- it_should_behave_like 'an api request' do
1168
- let(:command) { :update_project_task }
1169
- let(:args) { [random_id(:project_task), random_word] }
1170
- end
1171
- end
1172
-
1173
- describe '#get_project_team' do
1174
- it_should_behave_like 'an api request' do
1175
- let(:command) { :get_project_team }
1176
- let(:args) { [random_id(:new_project)] }
1177
- end
1178
- end
1179
-
1180
- describe '#get_projects_teams' do
1181
- it_should_behave_like 'an api request' do
1182
- let(:command) { :get_projects_teams }
1183
- let(:args) { [DATA_COLLECTOR[:new_project_ids].sample(rand(2..4))] }
1184
- end
1185
- end
1186
-
1187
- describe '#add_to_team' do
1188
- it_should_behave_like 'an api request' do
1189
- let(:command) { :add_to_team }
1190
- let(:args) { [random_id(:new_project), random_id(:user)] }
1191
- end
1192
- end
1193
-
1194
- describe '#update_project_team' do
1195
- it_should_behave_like 'an api request' do
1196
- let(:command) { :update_project_team }
1197
- let(:args) { [random_id(:new_project), DATA_COLLECTOR[:user_ids].sample(rand(2..4)), {notify: random_bool}] }
1198
- end
1199
- end
1200
-
1201
- describe '#set_team_security' do
1202
- it_should_behave_like 'an api request' do
1203
- let(:command) { :set_team_security }
1204
- let(:args) { [random_id(:new_project), random_id(:user), PROJECT_SECURITY_RIGHTS.sample] }
1205
- end
1206
- end
1207
-
1208
- describe '#remove_from_team' do
1209
- it_should_behave_like 'an api request' do
1210
- let(:command) { :remove_from_team }
1211
- let(:args) { [random_id(:new_project), random_id(:user)] }
1212
- end
1213
- end
1214
-
1215
- describe '#get_my_tasks' do
1216
- it_should_behave_like 'an api request' do
1217
- let(:command) { :get_my_tasks }
1218
- end
1219
- end
1220
-
1221
- describe '#get_task_by_filter' do
1222
- it_should_behave_like 'an api request' do
1223
- let(:command) { :get_task_by_filter }
1224
- let(:args) { [{participant: random_id(:user)}] }
1225
- end
1226
- end
1227
-
1228
- describe '#get_task' do
1229
- it_should_behave_like 'an api request' do
1230
- let(:command) { :get_task }
1231
- let(:args) { [random_id(:project_task)] }
1232
- end
1233
- end
1234
-
1235
- describe '#get_tasks' do
1236
- it_should_behave_like 'an api request' do
1237
- let(:command) { :get_tasks }
1238
- let(:args) { [random_id(:new_project)] }
1239
- end
1240
- end
1241
-
1242
- describe '#get_my_tasks_by_status' do
1243
- it_should_behave_like 'an api request' do
1244
- let(:command) { :get_my_tasks_by_status }
1245
- let(:args) { [PROJECT_TASKS_STATUSES.sample] }
1246
- end
1247
- end
1248
-
1249
- describe '#notify_task_responsible' do
1250
- it_should_behave_like 'an api request' do
1251
- let(:command) { :notify_task_responsible }
1252
- let(:args) { [random_id(:project_task)] }
1253
- end
1254
- end
1255
-
1256
- describe '#get_all_tasks' do
1257
- it_should_behave_like 'an api request' do
1258
- let(:command) { :get_all_tasks }
1259
- let(:args) { [random_id(:new_project)] }
1260
- end
1261
- end
1262
-
1263
- describe '#get_tasks_with_status' do
1264
- it_should_behave_like 'an api request' do
1265
- let(:command) { :get_tasks_with_status }
1266
- let(:args) { [random_id(:new_project), PROJECT_TASKS_STATUSES.sample] }
1267
- end
1268
- end
1269
-
1270
- describe '#update_task_status' do
1271
- it_should_behave_like 'an api request' do
1272
- pending 'http://bugzserver/show_bug.cgi?id=23860'
1273
- let(:command) { :update_task_status }
1274
- let(:args) { [random_id(:project_task), PROJECT_TASKS_STATUSES.sample] }
1275
- end
1276
- end
1277
-
1278
- describe '#update_subtask' do
1279
- it_should_behave_like 'an api request' do
1280
- pending 'http://bugzserver/show_bug.cgi?id=23860'
1281
- let(:command) { :update_subtask }
1282
- let(:args) { [DATA_COLLECTOR[:project_task_ids].last, random_id(:project_subtask), random_id(:user), random_word] }
1283
- end
1284
- end
1285
-
1286
- describe '#update_subtask_status' do
1287
- it_should_behave_like 'an api request' do
1288
- let(:command) { :update_subtask_status }
1289
- let(:args) { [DATA_COLLECTOR[:project_task_ids].last, random_id(:project_subtask), PROJECT_TASKS_STATUSES.sample] }
1290
- end
1291
- end
1292
-
1293
- describe '#add_project_contact' do
1294
- it_should_behave_like 'an api request' do
1295
- let(:command) { :add_project_contact }
1296
- let(:args) { [random_id(:new_project), random_id(:contact)] }
1297
- end
1298
- end
1299
-
1300
- describe '#get_projects_for_contact' do
1301
- it_should_behave_like 'an api request' do
1302
- let(:command) { :get_projects_for_contact }
1303
- let(:args) { [random_id(:contact)] }
1304
- end
1305
- end
1306
-
1307
- describe '#get_project_tags' do
1308
- it_should_behave_like 'an api request' do
1309
- let(:command) { :get_project_tags }
1310
- end
1311
- end
1312
-
1313
- describe '#get_project_by_tag' do
1314
- it_should_behave_like 'an api request' do
1315
- let(:command) { :get_project_by_tag }
1316
- let(:args) { [random_word(4)] }
1317
- end
1318
- end
1319
-
1320
- describe '#get_tags_by_name' do
1321
- it_should_behave_like 'an api request' do
1322
- let(:command) { :get_tags_by_name }
1323
- let(:args) { [random_word(4)] }
1324
- end
1325
- end
1326
-
1327
- describe '#get_upcoming_milestones' do
1328
- it_should_behave_like 'an api request' do
1329
- let(:command) { :get_upcoming_milestones }
1330
- end
1331
- end
1332
-
1333
- describe '#get_overdue_milestones' do
1334
- it_should_behave_like 'an api request' do
1335
- let(:command) { :get_overdue_milestones }
1336
- end
1337
- end
1338
-
1339
- describe '#get_milestone' do
1340
- it_should_behave_like 'an api request' do
1341
- let(:command) { :get_milestone }
1342
- let(:args) { [random_id(:project_milestone)] }
1343
- end
1344
- end
1345
-
1346
- describe '#get_milestones_by_filter' do
1347
- it_should_behave_like 'an api request' do
1348
- let(:command) { :get_milestones_by_filter }
1349
- let(:args) { [{projectid: random_id(:new_project)}] }
1350
- end
1351
- end
1352
-
1353
- describe '#get_milestone_tasks' do
1354
- it_should_behave_like 'an api request' do
1355
- let(:command) { :get_milestone_tasks }
1356
- let(:args) { [random_id(:project_milestone)] }
1357
- end
1358
- end
1359
-
1360
- describe '#get_milestones_by_month' do
1361
- it_should_behave_like 'an api request' do
1362
- let(:command) { :get_milestones_by_month }
1363
- let(:args) { [rand(2000..Time.now.year.to_i), rand(1..12)] }
1364
- end
1365
- end
1366
-
1367
- describe '#get_milestones_by_full_date' do
1368
- it_should_behave_like 'an api request' do
1369
- let(:command) { :get_milestones_by_full_date }
1370
- let(:args) { [rand(2000..Time.now.year.to_i), rand(1..12), rand(1..31)] }
1371
- end
1372
- end
1373
-
1374
- describe '#update_milestone' do
1375
- it_should_behave_like 'an api request' do
1376
- let(:command) { :update_milestone }
1377
- let(:args) { [random_id(:project_milestone), random_word, DateTime.commercial(2015).to_s] }
1378
- end
1379
- end
1380
-
1381
- describe '#update_milestone_status' do
1382
- it_should_behave_like 'an api request' do
1383
- let(:command) { :update_milestone_status }
1384
- let(:args) { [random_id(:project_milestone), PROJECT_MILESTONE_STATUSES.sample] }
1385
- end
1386
- end
1387
-
1388
- describe '#get_time_spent_by_filter' do
1389
- it_should_behave_like 'an api request' do
1390
- let(:command) { :get_time_spent_by_filter }
1391
- end
1392
- end
1393
-
1394
- describe '#get_total_time_spent_by_filter' do
1395
- it_should_behave_like 'an api request' do
1396
- let(:command) { :get_total_time_spent_by_filter }
1397
- end
1398
- end
1399
-
1400
- describe '#get_time_spent' do
1401
- it_should_behave_like 'an api request' do
1402
- let(:command) { :get_time_spent }
1403
- let(:args) { [random_id(:project_task)] }
1404
- end
1405
- end
1406
-
1407
- describe '#update_task_time' do
1408
- it_should_behave_like 'an api request' do
1409
- let(:command) { :update_task_time }
1410
- let(:args) { [random_id(:project_task_time), Time.now.strftime('%Y-%m-%-d'), random_id(:user)] }
1411
- end
1412
- end
1413
-
1414
- describe '#update_time_status_of_payment' do
1415
- it_should_behave_like 'an api request' do
1416
- let(:command) { :update_time_status_of_payment }
1417
- let(:args) { [DATA_COLLECTOR[:project_task_time_ids].sample(rand(2..4)), PROJECT_TASK_TIME_STATUSES.sample] }
1418
- end
1419
- end
1420
-
1421
- describe '#delete_time_spents' do
1422
- it_should_behave_like 'an api request' do
1423
- let(:command) { :delete_time_spents }
1424
- let(:args) { [DATA_COLLECTOR[:project_task_time_ids].pop] }
1425
- end
1426
- end
1427
-
1428
- describe '#delete_project_contact' do
1429
- it_should_behave_like 'an api request' do
1430
- let(:command) { :delete_project_contact }
1431
- let(:args) { [random_id(:new_project), random_id(:contact)] }
1432
- end
1433
- end
1434
-
1435
- describe '#delete_subtask' do
1436
- it_should_behave_like 'an api request' do
1437
- let(:command) { :delete_subtask }
1438
- let(:args) { [DATA_COLLECTOR[:project_task_ids].last, DATA_COLLECTOR[:project_subtask_ids].pop] }
1439
- end
1440
- end
1441
-
1442
- describe '#detach_file_from_task' do
1443
- it_should_behave_like 'an api request' do
1444
- let(:command) { :detach_file_from_task }
1445
- let(:args) { [random_id(:project_task), random_id(:file)] }
1446
- end
1447
- end
1448
-
1449
- describe '#detach_file_from_message' do
1450
- it_should_behave_like 'an api request' do
1451
- let(:command) { :detach_file_from_task }
1452
- let(:args) { [random_id(:discussion), random_id(:file)] }
1453
- end
1454
- end
1455
-
1456
- describe '#delete_message_comments' do
1457
- it_should_behave_like 'an api request' do
1458
- let(:command) { :delete_comment }
1459
- let(:args) { [DATA_COLLECTOR[:comment_ids].pop] }
1460
- end
1461
- end
1462
-
1463
- describe '#delete_milestone' do
1464
- it_should_behave_like 'an api request' do
1465
- let(:command) { :delete_milestone }
1466
- let(:args) { [DATA_COLLECTOR[:project_milestone_ids].pop] }
1467
- end
1468
- end
1469
-
1470
- describe '#delete_task_comments' do
1471
- it_should_behave_like 'an api request' do
1472
- let(:command) { :delete_comment }
1473
- let(:args) { [DATA_COLLECTOR[:comment_ids].pop] }
1474
- end
1475
- end
1476
-
1477
- describe '#delete_task' do
1478
- it_should_behave_like 'an api request' do
1479
- let(:command) { :delete_task }
1480
- let(:args) { [DATA_COLLECTOR[:project_task_ids].pop] }
1481
- end
1482
- end
1483
-
1484
- describe '#delete_project' do
1485
- it_should_behave_like 'an api request' do
1486
- let(:command) { :delete_project }
1487
- let(:args) { [DATA_COLLECTOR[:new_project_ids].pop] }
1488
- end
1489
- end
1490
-
1491
- describe '#delete_template' do
1492
- it_should_behave_like 'an api request' do
1493
- let(:command) { :delete_template }
1494
- let(:args) { [DATA_COLLECTOR[:project_template_ids].pop] }
1495
- end
1496
- end
1497
-
1498
- end
1499
-
1500
- describe '[CRM]' do
1501
-
1502
- let(:teamlab_module) { :crm }
1503
-
1504
- describe '#create_opportunity_stage' do
1505
- it_should_behave_like 'an api request' do
1506
- let(:teamlab_module) { :crm }
1507
- let(:command) { :create_opportunity_stage }
1508
- let(:args) { [random_word.capitalize, COLORS_NAMES.sample] }
1509
- let(:add_data_to_collector) { true }
1510
- let(:data_param) { :opportunity_stage_ids }
1511
- let(:param_names) { %w(id) }
1512
- end
1513
- end
1514
-
1515
- describe '#create_person' do
1516
- it_should_behave_like 'an api request' do
1517
- let(:teamlab_module) { :crm }
1518
- let(:command) { :create_person }
1519
- let(:args) { [random_word.capitalize, random_word.capitalize] }
1520
- let(:add_data_to_collector) { true }
1521
- let(:data_param) { :new_contact_ids }
1522
- let(:param_names) { %w(id) }
1523
- end
1524
- end
1525
-
1526
- describe '#create_person__for_group' do
1527
- it_should_behave_like 'an api request' do
1528
- let(:teamlab_module) { :crm }
1529
- let(:command) { :create_person }
1530
- let(:args) { [random_word.capitalize, random_word.capitalize] }
1531
- let(:add_data_to_collector) { true }
1532
- let(:data_param) { :new_contact_ids }
1533
- let(:param_names) { %w(id) }
1534
- end
1535
- end
1536
-
1537
- describe '#create_opportunity' do
1538
- it_should_behave_like 'an api request' do
1539
- let(:command) { :create_opportunity }
1540
- let(:args) { [random_id(:opportunity_stage), random_word, random_id(:user)] }
1541
- let(:add_data_to_collector) { true }
1542
- let(:data_param) { :opportunity_ids }
1543
- let(:param_names) { %w(id) }
1544
- end
1545
- end
1546
-
1547
- describe '#create_opportunity_for_group' do
1548
- it_should_behave_like 'an api request' do
1549
- let(:command) { :create_opportunity }
1550
- let(:args) { [random_id(:opportunity_stage), random_word, random_id(:user)] }
1551
- let(:add_data_to_collector) { true }
1552
- let(:data_param) { :opportunity_ids }
1553
- let(:param_names) { %w(id) }
1554
- end
1555
- end
1556
-
1557
- describe '#create_invoice' do
1558
- it_should_behave_like 'an api request' do
1559
- pending 'http://bugzserver/show_bug.cgi?id=23886'
1560
- let(:command) { :create_invoice }
1561
- let(:args) { [] }
1562
- let(:add_data_to_collector) { true }
1563
- let(:data_param) { :invoice_ids }
1564
- let(:param_names) { %w(id) }
1565
- end
1566
- end
1567
-
1568
- describe '#create_invoice_for_batch' do
1569
- it_should_behave_like 'an api request' do
1570
- pending 'http://bugzserver/show_bug.cgi?id=23886'
1571
- let(:command) { :create_invoice }
1572
- let(:args) { [] }
1573
- let(:add_data_to_collector) { true }
1574
- let(:data_param) { :invoice_ids }
1575
- let(:param_names) { %w(id) }
1576
- end
1577
- end
1578
-
1579
- describe '#create_history_category' do
1580
- it_should_behave_like 'an api request' do
1581
- let(:command) { :create_history_category }
1582
- let(:args) { [random_word, random_word] }
1583
- let(:add_data_to_collector) { true }
1584
- let(:data_param) { :crm_history_category_ids }
1585
- let(:param_names) { %w(id) }
1586
- end
1587
- end
1588
-
1589
- describe '#create_invoice_line' do
1590
- it_should_behave_like 'an api request' do
1591
- pending 'http://bugzserver/show_bug.cgi?id=23886, http://bugzserver/show_bug.cgi?id=23888'
1592
- let(:command) { :create_invoice_line }
1593
- let(:args) { [random_id(:invoice)] }
1594
- let(:add_data_to_collector) { true }
1595
- let(:data_param) { :invoice_line_ids }
1596
- let(:param_names) { %w(id) }
1597
- end
1598
- end
1599
-
1600
- describe '#create_invoice_item' do
1601
- it_should_behave_like 'an api request' do
1602
- let(:command) { :create_invoice_item }
1603
- let(:args) { [random_word, random_word, rand, random_word] }
1604
- let(:add_data_to_collector) { true }
1605
- let(:data_param) { :invoice_item_ids }
1606
- let(:param_names) { %w(id) }
1607
- end
1608
- end
1609
-
1610
- describe '#create_invoice_item_for_batch' do
1611
- it_should_behave_like 'an api request' do
1612
- let(:command) { :create_invoice_item }
1613
- let(:args) { [random_word, random_word, rand, random_word] }
1614
- let(:add_data_to_collector) { true }
1615
- let(:data_param) { :invoice_item_ids }
1616
- let(:param_names) { %w(id) }
1617
- end
1618
- end
1619
-
1620
- describe '#create_invoice_tax' do
1621
- it_should_behave_like 'an api request' do
1622
- let(:command) { :create_invoice_tax }
1623
- let(:args) { [random_word, random_word] }
1624
- let(:add_data_to_collector) { true }
1625
- let(:data_param) { :invoice_tax_ids }
1626
- let(:param_names) { %w(id) }
1627
- end
1628
- end
1629
-
1630
- describe '#create_contact_type' do
1631
- it_should_behave_like 'an api request' do
1632
- let(:command) { :create_contact_type }
1633
- let(:args) { [random_word] }
1634
- let(:add_data_to_collector) { true }
1635
- let(:data_param) { :contact_type_ids }
1636
- let(:param_names) { %w(id) }
1637
- end
1638
- end
1639
-
1640
- describe '#create_contact_status' do
1641
- it_should_behave_like 'an api request' do
1642
- let(:command) { :create_contact_status }
1643
- let(:args) { [random_word, COLORS_NAMES.sample] }
1644
- let(:add_data_to_collector) { true }
1645
- let(:data_param) { :contact_status_ids }
1646
- let(:param_names) { %w(id) }
1647
- end
1648
- end
1649
-
1650
- describe '#create_company' do
1651
- it_should_behave_like 'an api request' do
1652
- let(:command) { :create_company }
1653
- let(:args) { [random_word, [random_id(:user)]] }
1654
- let(:add_data_to_collector) { true }
1655
- let(:data_param) { :company_ids }
1656
- let(:param_names) { %w(id) }
1657
- end
1658
- end
1659
-
1660
- #describe '#create_task_group' do
1661
- # it_should_behave_like 'an api request' do
1662
- # let(:command) { :create_task_group }
1663
- # let(:args) { [random_word] }
1664
- # let(:add_data_to_collector) { true }
1665
- # let(:data_param) { :task_group_ids }
1666
- # let(:param_names) { %w(id) }
1667
- # end
1668
- #end
1669
-
1670
- describe '#update_history_category' do
1671
- it_should_behave_like 'an api request' do
1672
- let(:command) { :update_history_category }
1673
- i = -1
1674
- let(:args) { [DATA_COLLECTOR[:crm_history_category_ids][i += 1], random_word] }
1675
- let(:add_data_to_collector) { true }
1676
- let(:data_param) { :history_category_titles }
1677
- let(:param_names) { %w(title) }
1678
- end
1679
- end
1680
-
1681
- describe '#create_event' do
1682
- it_should_behave_like 'an api request' do
1683
- let(:command) { :create_event }
1684
- let(:args) { [random_id(:new_contact), random_word, random_id(:crm_history_category)] }
1685
- let(:add_data_to_collector) { true }
1686
- let(:data_param) { :crm_event_ids }
1687
- let(:param_names) { %w(id) }
1688
- end
1689
- end
1690
-
1691
- describe '#create_task_category' do
1692
- it_should_behave_like 'an api request' do
1693
- let(:command) { :create_task_category }
1694
- let(:args) { [random_word, random_word] }
1695
- let(:add_data_to_collector) { true }
1696
- let(:data_param) { :crm_task_category_ids }
1697
- let(:param_names) { %w(id) }
1698
- end
1699
- end
1700
-
1701
- describe '#update_task_category' do
1702
- it_should_behave_like 'an api request' do
1703
- let(:command) { :update_task_category }
1704
- i = -1
1705
- let(:args) { [DATA_COLLECTOR[:crm_task_category_ids][i += 1], random_word] }
1706
- let(:add_data_to_collector) { true }
1707
- let(:data_param) { :crm_task_category_titles }
1708
- let(:param_names) { %w(title) }
1709
- end
1710
- end
1711
-
1712
- describe '#create_task' do
1713
- it_should_behave_like 'an api request' do
1714
- let(:command) { :create_task }
1715
- let(:args) { [random_word, DateTime.commercial(2015).to_s, random_id(:user), random_id(:crm_task_category)] }
1716
- let(:add_data_to_collector) { true }
1717
- let(:data_param) { :crm_task_ids }
1718
- let(:param_names) { %w(id) }
1719
- end
1720
- end
1721
-
1722
- describe '#add_contact_info' do
1723
- it_should_behave_like 'an api request' do
1724
- let(:command) { :add_contact_info }
1725
- i = -1
1726
- let(:args) { [DATA_COLLECTOR[:new_contact_ids][i+=1], info_type = CONTACT_INFO_TYPES.sample, random_word, random_info_category(info_type)] }
1727
- let(:add_data_to_collector) { true }
1728
- let(:data_param) { :contact_info_ids }
1729
- let(:param_names) { %w(id) }
1730
- end
1731
- end
1732
-
1733
- describe '#quick_person_list_creation' do
1734
- it_should_behave_like 'an api request' do
1735
- pending ('http://bugzserver/show_bug.cgi?id=23997')
1736
- let(:command) { :quick_person_list_creation }
1737
- let(:args) { [[[random_word, random_word], [random_word, random_word]]] }
1738
- end
1739
- end
1740
-
1741
- describe '#add_opportunity_contact' do
1742
- it_should_behave_like 'an api request' do
1743
- let(:command) { :add_opportunity_contact }
1744
- i = -1
1745
- let(:args) { [DATA_COLLECTOR[:opportunity_ids].last, DATA_COLLECTOR[:new_contact_ids][i+=1]] }
1746
- end
1747
- end
1748
-
1749
- describe '#create_task_template_container' do
1750
- it_should_behave_like 'an api request' do
1751
- let(:command) { :create_task_template_container }
1752
- let(:args) { [ENTITY_TYPES.sample.sub('company', 'contact'), random_word] }
1753
- let(:add_data_to_collector) { true }
1754
- let(:data_param) { :task_template_container_ids }
1755
- let(:param_names) { %w(id) }
1756
- end
1757
- end
1758
-
1759
- describe '#create_task_template' do
1760
- it_should_behave_like 'an api request' do
1761
- let(:command) { :create_task_template }
1762
- let(:args) { [DATA_COLLECTOR[:task_template_container_ids].last, random_word] }
1763
- let(:add_data_to_collector) { true }
1764
- let(:data_param) { :task_template_ids }
1765
- let(:param_names) { %w(id) }
1766
- end
1767
- end
1768
-
1769
- describe '#create_case' do
1770
- it_should_behave_like 'an api request' do
1771
- let(:command) { :create_case }
1772
- let(:args) { [random_word, { members: DATA_COLLECTOR[:new_contact_ids] }] }
1773
- let(:add_data_to_collector) { true }
1774
- let(:data_param) { :crm_case_ids }
1775
- let(:param_names) { %w(id) }
1776
- end
1777
- end
1778
-
1779
- describe '#create_case_for_group_deleting' do
1780
- it_should_behave_like 'an api request' do
1781
- let(:command) { :create_case }
1782
- let(:args) { [random_word] }
1783
- let(:add_data_to_collector) { true }
1784
- let(:data_param) { :crm_case_ids }
1785
- let(:param_names) { %w(id) }
1786
- end
1787
- end
1788
-
1789
- describe '#create_case_for_group_deleting_by_filter' do
1790
- it_should_behave_like 'an api request' do
1791
- let(:command) { :create_case }
1792
- let(:args) { [random_word] }
1793
- let(:add_data_to_collector) { true }
1794
- let(:data_param) { :crm_case_ids }
1795
- let(:param_names) { %w(id) }
1796
- end
1797
- end
1798
-
1799
- describe '#create_user_field' do
1800
- it_should_behave_like 'an api request' do
1801
- let(:command) { :create_user_field }
1802
- let(:args) { [ENTITY_TYPES.last, random_word, rand(6)] }
1803
- let(:add_data_to_collector) { true }
1804
- let(:data_param) { :user_field_ids }
1805
- let(:param_names) { %w(id) }
1806
- end
1807
- end
1808
-
1809
- describe '#get_all_opportunity_stages' do
1810
- it_should_behave_like 'an api request' do
1811
- let(:command) { :get_all_opportunity_stages }
1812
- end
1813
- end
1814
-
1815
- describe '#get_curreny_list' do
1816
- it_should_behave_like 'an api request' do
1817
- let(:command) { :get_currency_list }
1818
- end
1819
- end
1820
-
1821
- describe '#get_opportunity_list' do
1822
- it_should_behave_like 'an api request' do
1823
- let(:command) { :get_opportunity_list }
1824
- end
1825
- end
1826
-
1827
- describe '#get_result_of_convertation' do
1828
- it_should_behave_like 'an api request' do
1829
- let(:command) { :get_result_of_convertation }
1830
- end
1831
- end
1832
-
1833
- describe '#get_opportunity_stage' do
1834
- it_should_behave_like 'an api request' do
1835
- let(:command) { :get_opportunity_stage }
1836
- let(:args) { [random_id(:opportunity_stage)] }
1837
- end
1838
- end
1839
-
1840
- describe '#get_opportunity_by_id' do
1841
- it_should_behave_like 'an api request' do
1842
- let(:command) { :get_opportunity_by_id }
1843
- let(:args) { [random_id(:opportunity)] }
1844
- end
1845
- end
1846
-
1847
- describe '#get_all_opportunity_contacts' do
1848
- it_should_behave_like 'an api request' do
1849
- let(:command) { :get_all_opportunity_contacts }
1850
- let(:args) { [random_id(:opportunity)] }
1851
- end
1852
- end
1853
-
1854
- describe '#get_summary_table' do
1855
- it_should_behave_like 'an api request' do
1856
- pending 'http://bugzserver/show_bug.cgi?id=23883'
1857
- let(:command) { :get_summary_table }
1858
- let(:args) { [random_word] }
1859
- end
1860
- end
1861
-
1862
- describe '#set_opportunity_access_rights' do
1863
- it_should_behave_like 'an api request' do
1864
- let(:command) { :set_opportunity_access_rights }
1865
- let(:args) { [[random_id(:opportunity)], random_bool, random_id(:user)] }
1866
- end
1867
- end
1868
-
1869
- describe '#update_opportunity_stage' do
1870
- it_should_behave_like 'an api request' do
1871
- pending 'http://bugzserver/show_bug.cgi?id=23884'
1872
- let(:command) { :update_opportunity_stage }
1873
- let(:args) { [random_id(:opportunity_stage), random_word, COLORS_NAMES.sample] }
1874
- end
1875
- end
1876
-
1877
- describe '#update_opportunity_stages_order' do
1878
- it_should_behave_like 'an api request' do
1879
- let(:command) { :update_opportunity_stages_order }
1880
- let(:args) { [DATA_COLLECTOR[:opportunity_stage_ids].sample(rand(1..3))] }
1881
- end
1882
- end
1883
-
1884
- describe '#set_opportunity_access_rights_for_users' do
1885
- it_should_behave_like 'an api request' do
1886
- let(:command) { :set_opportunity_access_rights_for_users }
1887
- end
1888
- end
1889
-
1890
- describe '#update_opportunity_to_stage' do
1891
- it_should_behave_like 'an api request' do
1892
- let(:command) { :update_opportunity_to_stage }
1893
- let(:args) { [random_id(:opportunity), random_id(:opportunity_stage)] }
1894
- end
1895
- end
1896
-
1897
- describe '#get_invoice_taxes' do
1898
- it_should_behave_like 'an api request' do
1899
- let(:command) { :get_invoice_taxes }
1900
- end
1901
- end
1902
-
1903
- describe '#get_contacts_for_mail' do
1904
- it_should_behave_like 'an api request' do
1905
- let(:command) { :get_contacts_for_mail }
1906
- let(:args) { [DATA_COLLECTOR[:new_contact_ids].sample(rand(1..3))] }
1907
- end
1908
- end
1909
-
1910
- describe '#get_cases_by_prefix' do
1911
- it_should_behave_like 'an api request' do
1912
- let(:command) { :get_cases_by_prefix }
1913
- let(:args) { [random_id(:new_contact), random_word] }
1914
- end
1915
- end
1916
-
1917
- describe '#get_contact_statuses' do
1918
- it_should_behave_like 'an api request' do
1919
- let(:command) { :get_contact_statuses }
1920
- end
1921
- end
1922
-
1923
- describe '#get_invoice_sample' do
1924
- it_should_behave_like 'an api request' do
1925
- let(:command) { :get_invoice_sample }
1926
- end
1927
- end
1928
-
1929
- describe '#get_invoices_by_filter' do
1930
- it_should_behave_like 'an api request' do
1931
- let(:command) { :get_invoices_by_filter }
1932
- end
1933
- end
1934
-
1935
- describe '#get_contacts_by_filter' do
1936
- it_should_behave_like 'an api request' do
1937
- let(:command) { :get_contacts_by_filter }
1938
- end
1939
- end
1940
-
1941
- describe '#get_settings' do
1942
- it_should_behave_like 'an api request' do
1943
- let(:command) { :get_settings }
1944
- end
1945
- end
1946
-
1947
- describe '#get_invoice_items_by_filter' do
1948
- it_should_behave_like 'an api request' do
1949
- let(:command) { :get_invoice_items_by_filter }
1950
- end
1951
- end
1952
-
1953
- describe '#get_entity_invoices' do
1954
- it_should_behave_like 'an api request' do
1955
- let(:command) { :get_entity_invoices }
1956
- let(:args) { [:contact, random_id(:new_contact)] }
1957
- end
1958
- end
1959
-
1960
- describe '#create_task_group' do
1961
- it_should_behave_like 'an api request' do
1962
- let(:command) { :create_task_group }
1963
- let(:args) { [random_word] }
1964
- end
1965
- end
1966
-
1967
- describe '#add_tag_to_batch_contacts' do
1968
- it_should_behave_like 'an api request' do
1969
- let(:command) { :add_tag_to_batch_contacts }
1970
- let(:args) { [(1..rand(1..4)).map {random_word(rand(3..6))}] }
1971
- end
1972
- end
1973
-
1974
- describe '#add_contact_tag_to_group' do
1975
- it_should_behave_like 'an api request' do
1976
- let(:command) { :add_contact_tag_to_group }
1977
- let(:args) { [:company, random_id(:company), random_word(4)] }
1978
- end
1979
- end
1980
-
1981
- describe '#add_deal_to_contact' do
1982
- it_should_behave_like 'an api request' do
1983
- let(:command) { :add_deal_to_contact }
1984
- let(:args) { [random_id(:new_contact), random_id(:opportunity)] }
1985
- end
1986
- end
1987
-
1988
- describe '#set_is_portal_configured' do
1989
- it_should_behave_like 'an api request' do
1990
- let(:command) { :set_is_portal_configured }
1991
- let(:args) { [{configured: random_bool}] }
1992
- end
1993
- end
1994
-
1995
- describe '#update_task' do
1996
- it_should_behave_like 'an api request' do
1997
- let(:command) { :update_task }
1998
- let(:args) { [random_id(:crm_task), random_word, DateTime.commercial(2015).to_s, random_id(:crm_task_category)] }
1999
- end
2000
- end
2001
-
2002
- describe '#update_invoice_item' do
2003
- it_should_behave_like 'an api request' do
2004
- let(:command) { :update_invoice_item }
2005
- let(:args) { [random_id(:invoice_item), random_word, random_word, rand, random_word] }
2006
- end
2007
- end
2008
-
2009
- describe '#update_invoice_tax' do
2010
- it_should_behave_like 'an api request' do
2011
- let(:command) { :update_invoice_tax }
2012
- let(:args) { [random_id(:invoice_tax), random_word] }
2013
- end
2014
- end
2015
-
2016
- describe '#update_contact_type' do
2017
- it_should_behave_like 'an api request' do
2018
- let(:command) { :update_contact_type }
2019
- let(:args) { [random_id(:contact_type), random_word] }
2020
- let(:add_data_to_collector) { true }
2021
- let(:data_param) { :contact_types_titles }
2022
- let(:param_names) { %w(title) }
2023
- end
2024
- end
2025
-
2026
- describe '#update_contact_status' do
2027
- it_should_behave_like 'an api request' do
2028
- let(:command) { :update_contact_status }
2029
- let(:args) { [random_id(:contact_status), random_word, {color: COLORS_NAMES.sample}] }
2030
- end
2031
- end
2032
-
2033
- describe '#update_invoice' do
2034
- it_should_behave_like 'an api request' do
2035
- pending 'http://bugzserver/show_bug.cgi?id=23886'
2036
- let(:command) { :update_invoice }
2037
- let(:args) { [random_id(:invoice)] }
2038
- end
2039
- end
2040
-
2041
- describe '#update_crm_contact_tag_setting' do
2042
- it_should_behave_like 'an api request' do
2043
- let(:command) { :update_crm_contact_tag_setting }
2044
- end
2045
- end
2046
-
2047
- describe '#save_number_settings' do
2048
- it_should_behave_like 'an api request' do
2049
- let(:command) { :save_number_settings }
2050
- end
2051
- end
2052
-
2053
- describe '#set_access_to_batch_contact' do
2054
- it_should_behave_like 'an api request' do
2055
- let(:command) { :set_access_to_batch_contact }
2056
- end
2057
- end
2058
-
2059
- describe '#update_statuses_contact_order' do
2060
- it_should_behave_like 'an api request' do
2061
- let(:command) { :update_statuses_contact_order }
2062
- end
2063
- end
2064
-
2065
- describe '#save_terms_settings' do
2066
- it_should_behave_like 'an api request' do
2067
- let(:command) { :save_terms_settings }
2068
- end
2069
- end
2070
-
2071
- describe '#update_crm_contact_status_settings' do
2072
- it_should_behave_like 'an api request' do
2073
- let(:command) { :update_crm_contact_status_settings }
2074
- end
2075
- end
2076
-
2077
- describe '#update_invoice_patch_status' do
2078
- it_should_behave_like 'an api request' do
2079
- pending 'http://bugzserver/show_bug.cgi?id=23886'
2080
- let(:command) { :update_invoice_patch_status }
2081
- let(:args) { [INVOICE_STATUSES.sample, DATA_COLLECTOR[:invoice_ids].sample(rand(1..3))] }
2082
- end
2083
- end
2084
-
2085
- describe '#update_contact_status_color' do
2086
- it_should_behave_like 'an api request' do
2087
- let(:command) { :update_contact_status_color }
2088
- let(:args) { [random_id(:contact_status), COLORS_NAMES.sample] }
2089
- end
2090
- end
2091
-
2092
- describe '#update_person' do
2093
- it_should_behave_like 'an api request' do
2094
- let(:command) { :update_person }
2095
- let(:args) { [random_id(:new_contact), random_word.capitalize, random_word.capitalize] }
2096
- end
2097
- end
2098
-
2099
- describe '#update_contact_status_by_id' do
2100
- it_should_behave_like 'an api request' do
2101
- let(:command) { :update_contact_status_by_id }
2102
- let(:args) { [random_id(:new_contact), random_id(:contact_status)] }
2103
- end
2104
- end
2105
-
2106
- describe '#update_invoice_line' do
2107
- it_should_behave_like 'an api request' do
2108
- pending 'http://bugzserver/show_bug.cgi?id=23886, http://bugzserver/show_bug.cgi?id=23888'
2109
- let(:command) { :update_invoice_line }
2110
- let(:args) { [random_id(:invoice_line), random_id(:invoice)] }
2111
- end
2112
- end
2113
-
2114
- #describe '#change_contact_photo' do
2115
- # it_should_behave_like 'an api request' do
2116
- # let(:command) { :change_contact_photo }
2117
- # let(:args) { [random_id(:new_contact), 'path_to_image'] }
2118
- # end
2119
- #end
2120
-
2121
- describe '#update_person_and_its_company_status' do
2122
- it_should_behave_like 'an api request' do
2123
- let(:command) { :update_person_and_its_company_status }
2124
- let(:args) { [random_id(:new_contact), random_id(:contact_status)] }
2125
- end
2126
- end
2127
-
2128
- describe '#update_company_and_participants_status' do
2129
- it_should_behave_like 'an api request' do
2130
- let(:command) { :update_company_and_participants_status }
2131
- let(:args) { [random_id(:company), random_id(:contact_status)] }
2132
- end
2133
- end
2134
-
2135
- describe '#get_event_list_by_filter' do
2136
- it_should_behave_like 'an api request' do
2137
- let(:command) { :get_event_list_by_filter }
2138
- end
2139
- end
2140
-
2141
- describe '#get_all_history_categories' do
2142
- it_should_behave_like 'an api request' do
2143
- let(:command) { :get_all_history_categories }
2144
- end
2145
- end
2146
-
2147
- describe '#get_all_history_categories' do
2148
- it_should_behave_like 'an api request' do
2149
- let(:command) { :get_all_history_categories }
2150
- end
2151
- end
2152
-
2153
- describe '#update_history_categories_order' do
2154
- it_should_behave_like 'an api request' do
2155
- let(:command) { :update_history_categories_order }
2156
- let(:args) { [DATA_COLLECTOR[:history_category_titles].shuffle] }
2157
- end
2158
- end
2159
-
2160
- describe '#update_history_category_icon' do
2161
- it_should_behave_like 'an api request' do
2162
- let(:command) { :update_history_category_icon }
2163
- let(:args) { [random_id(:crm_history_category), random_word] }
2164
- end
2165
- end
2166
-
2167
- describe '#get_task_list_by_filter' do
2168
- it_should_behave_like 'an api request' do
2169
- let(:command) { :get_task_list_by_filter }
2170
- end
2171
- end
2172
-
2173
- describe '#get_all_task_categories' do
2174
- it_should_behave_like 'an api request' do
2175
- let(:command) { :get_all_task_categories }
2176
- end
2177
- end
2178
-
2179
- describe '#get_task_by_id' do
2180
- it_should_behave_like 'an api request' do
2181
- let(:command) { :get_task_by_id }
2182
- let(:args) { [random_id(:crm_task)] }
2183
- end
2184
- end
2185
-
2186
- describe '#get_task_category' do
2187
- it_should_behave_like 'an api request' do
2188
- let(:command) { :get_task_category }
2189
- let(:args) { [random_id(:crm_task_category)] }
2190
- end
2191
- end
2192
-
2193
- describe '#get_contact_upcoming_tasks' do
2194
- it_should_behave_like 'an api request' do
2195
- #pending 'http://bugzserver/show_bug.cgi?id=23925'
2196
- let(:command) { :get_contact_upcoming_tasks }
2197
- let(:args) { [random_id(:new_contact)] }
2198
- end
2199
- end
2200
-
2201
- describe '#close_task' do
2202
- it_should_behave_like 'an api request' do
2203
- let(:command) { :close_task }
2204
- let(:args) { [random_id(:crm_task)] }
2205
- end
2206
- end
2207
-
2208
- describe '#resume_task' do
2209
- it_should_behave_like 'an api request' do
2210
- let(:command) { :resume_task }
2211
- let(:args) { [random_id(:crm_task)] }
2212
- end
2213
- end
2214
-
2215
- describe '#update_task_categories_order' do
2216
- it_should_behave_like 'an api request' do
2217
- let(:command) { :update_task_categories_order }
2218
- let(:args) { [DATA_COLLECTOR[:crm_task_category_titles].shuffle] }
2219
- end
2220
- end
2221
-
2222
- describe '#update_task_category_icon' do
2223
- it_should_behave_like 'an api request' do
2224
- let(:command) { :update_task_category_icon }
2225
- let(:args) { [random_id(:crm_task_category), random_word] }
2226
- end
2227
- end
2228
-
2229
- describe '#get_all_contact_types' do
2230
- it_should_behave_like 'an api request' do
2231
- let(:command) { :get_all_contact_types }
2232
- end
2233
- end
2234
-
2235
- describe '#get_contact_by_id' do
2236
- it_should_behave_like 'an api request' do
2237
- let(:command) { :get_contact_by_id }
2238
- let(:args) { [random_id(:new_contact)] }
2239
- end
2240
- end
2241
-
2242
- describe '#get_all_contact_info_types' do
2243
- it_should_behave_like 'an api request' do
2244
- let(:command) { :get_all_contact_info_types }
2245
- end
2246
- end
2247
-
2248
- describe '#link_contact_list_with_project' do
2249
- it_should_behave_like 'an api request' do
2250
- let(:command) { :link_contact_list_with_project }
2251
- let(:args) { [random_id(:project), DATA_COLLECTOR[:new_contact_ids].sample(rand(1..4))] }
2252
- end
2253
- end
2254
-
2255
- describe '#link_contact_with_project' do
2256
- it_should_behave_like 'an api request' do
2257
- let(:command) { :link_contact_with_project }
2258
- let(:args) { [random_id(:project), random_id(:new_contact)] }
2259
- end
2260
- end
2261
-
2262
- describe '#add_persons_to_company' do
2263
- it_should_behave_like 'an api request' do
2264
- let(:command) { :add_persons_to_company }
2265
- i = -1
2266
- let(:args) { [DATA_COLLECTOR[:company_ids].last, DATA_COLLECTOR[:new_contact_ids][i+=1]] }
2267
- end
2268
- end
2269
-
2270
- describe '#get_contacts_by_project_id' do
2271
- it_should_behave_like 'an api request' do
2272
- let(:command) { :get_contacts_by_project_id }
2273
- let(:args) { [random_id(:project)] }
2274
- end
2275
- end
2276
-
2277
- describe '#get_contact_type' do
2278
- it_should_behave_like 'an api request' do
2279
- let(:command) { :get_contact_type }
2280
- let(:args) { [random_id(:contact_type)] }
2281
- end
2282
- end
2283
-
2284
- describe '#get_contact_info' do
2285
- it_should_behave_like 'an api request' do
2286
- let(:command) { :get_contact_info }
2287
- let(:args) { [random_id(:new_contact), CONTACT_INFO_TYPES.sample] }
2288
- end
2289
- end
2290
-
2291
- describe '#get_all_categories' do
2292
- it_should_behave_like 'an api request' do
2293
- let(:command) { :get_all_categories }
2294
- let(:args) { [CONTACT_INFO_TYPES.sample] }
2295
- end
2296
- end
2297
-
2298
- describe '#get_company_linked_persons_list' do
2299
- it_should_behave_like 'an api request' do
2300
- let(:command) { :get_company_linked_persons_list }
2301
- let(:args) { [random_id(:company)] }
2302
- end
2303
- end
2304
-
2305
- describe '#get_contact_information_by_type' do
2306
- it_should_behave_like 'an api request' do
2307
- let(:command) { :get_contact_information_by_type }
2308
- let(:args) { [random_id(:new_contact), CONTACT_INFO_TYPES.sample] }
2309
- end
2310
- end
2311
-
2312
- describe '#group_contact_info' do
2313
- it_should_behave_like 'an api request' do
2314
- pending 'http://bugzserver/show_bug.cgi?id=23988'
2315
- let(:command) { :group_contact_info }
2316
- let(:args) { [[random_id(:new_contact), CONTACT_INFO_TYPES.sample]] }
2317
- end
2318
- end
2319
-
2320
- describe '#quick_company_list_creation' do
2321
- it_should_behave_like 'an api request' do
2322
- let(:command) { :quick_company_list_creation }
2323
- let(:args) { [random_word] }
2324
- end
2325
- end
2326
-
2327
- describe '#add_contact_address' do
2328
- it_should_behave_like 'an api request' do
2329
- let(:command) { :add_contact_address }
2330
- i = -1
2331
- let(:args) { [DATA_COLLECTOR[:new_contact_ids][i+=1], random_info_category('Address'), random_word] }
2332
- let(:add_data_to_collector) { true }
2333
- let(:data_param) { :contact_address_ids }
2334
- let(:param_names) { %w() }
2335
- end
2336
- end
2337
-
2338
- describe '#group_contact_info_update' do
2339
- it_should_behave_like 'an api request' do
2340
- pending 'http://bugzserver/show_bug.cgi?id=23988'
2341
- let(:command) { :group_contact_info_update }
2342
- let(:args) { [[random_id(:new_contact), CONTACT_INFO_TYPES.sample]] }
2343
- end
2344
- end
2345
-
2346
- describe '#merge_contacts' do
2347
- it_should_behave_like 'an api request' do
2348
- let(:command) { :merge_contacts }
2349
- let(:args) { [random_id(:new_contact), random_id(:new_contact)] }
2350
- end
2351
- end
2352
-
2353
- describe '#set_contacts_access_rights' do
2354
- it_should_behave_like 'an api request' do
2355
- let(:command) { :set_contacts_access_rights }
2356
- let(:args) { [[DATA_COLLECTOR[:new_contact_ids].sample(rand(1..4))]] }
2357
- end
2358
- end
2359
-
2360
- describe '#update_contact_types_order' do
2361
- it_should_behave_like 'an api request' do
2362
- let(:command) { :update_contact_types_order }
2363
- let(:args) { [DATA_COLLECTOR[:contact_types_titles].sample(rand(1..4))] }
2364
- end
2365
- end
2366
-
2367
- describe '#set_contact_access_rights' do
2368
- it_should_behave_like 'an api request' do
2369
- let(:command) { :set_contact_access_rights }
2370
- let(:args) { [ random_id(:new_contact) ] }
2371
- end
2372
- end
2373
-
2374
- describe '#update_company' do
2375
- it_should_behave_like 'an api request' do
2376
- let(:command) { :update_company }
2377
- let(:args) { [ random_id(:company), random_word ] }
2378
- end
2379
- end
2380
-
2381
- describe '#update_contact_info' do
2382
- it_should_behave_like 'an api request' do
2383
- let(:command) { :update_contact_info }
2384
- let(:args) { [ random_id(:contact_info), random_id(:new_contact), random_word ] }
2385
- end
2386
- end
2387
-
2388
- describe '#change_contact_photo_by_url' do
2389
- it_should_behave_like 'an api request' do
2390
- let(:command) { :change_contact_photo_by_url }
2391
- let(:args) { [ random_id(:new_contact), IMAGE_URL ] }
2392
- end
2393
- end
2394
-
2395
- describe '#update_contact_address' do
2396
- it_should_behave_like 'an api request' do
2397
- pending('http://bugzserver/show_bug.cgi?id=24002')
2398
- let(:command) { :update_contact_address }
2399
- let(:args) { [ random_id(:new_contact), random_id(:contact_address), random_word ] }
2400
- end
2401
- end
2402
-
2403
- describe '#get_root_folder_id' do
2404
- it_should_behave_like 'an api request' do
2405
- let(:command) { :get_root_folder_id }
2406
- end
2407
- end
2408
-
2409
- describe '#associate_file_with_entity' do
2410
- it_should_behave_like 'an api request' do
2411
- let(:command) { :associate_file_with_entity }
2412
- let(:args) { [(entity = ENTITY_TYPES.sample).sub('company', 'contact'), random_id(entity.to_sym), DATA_COLLECTOR[:file_ids].sample(rand(1..4))] }
2413
- end
2414
- end
2415
-
2416
- describe '#create_txt' do
2417
- it_should_behave_like 'an api request' do
2418
- let(:command) { :create_txt }
2419
- let(:args) { [(entity = ENTITY_TYPES.sample).sub('company', 'contact'), random_id(entity.to_sym), random_word] }
2420
- let(:add_data_to_collector) { true }
2421
- let(:data_param) { :crm_file_ids }
2422
- let(:param_names) { %w(id) }
2423
- end
2424
- end
2425
-
2426
- describe '#get_file_list' do
2427
- it_should_behave_like 'an api request' do
2428
- let(:command) { :get_file_list }
2429
- let(:args) { [(entity = ENTITY_TYPES.sample).sub('company', 'contact'), random_id(entity.to_sym)] }
2430
- end
2431
- end
2432
-
2433
- describe '#upload_file' do
2434
- it_should_behave_like 'an api request' do
2435
- let(:command) { :upload_file }
2436
- let(:args) { [entity = ENTITY_TYPES.sample, random_id(entity.to_sym), FILES_FOR_UPLOAD.sample] }
2437
- end
2438
- end
2439
-
2440
- describe '#create_tag' do
2441
- it_should_behave_like 'an api request' do
2442
- let(:command) { :create_tag }
2443
- let(:args) { [ENTITY_TYPES.last, random_word(4)] }
2444
- let(:add_data_to_collector) { true }
2445
- let(:data_param) { :crm_tag_ids }
2446
- let(:param_names) { %w() }
2447
- end
2448
- end
2449
-
2450
- describe '#get_tags_for_entity_type' do
2451
- it_should_behave_like 'an api request' do
2452
- let(:command) { :get_tags_for_entity_type }
2453
- let(:args) { [ENTITY_TYPES.sample] }
2454
- end
2455
- end
2456
-
2457
- describe '#get_all_contact_tags' do
2458
- it_should_behave_like 'an api request' do
2459
- let(:command) { :get_all_contact_tags }
2460
- let(:args) { [random_id(:new_contact)] }
2461
- end
2462
- end
2463
-
2464
- describe '#get_entity_tags' do
2465
- it_should_behave_like 'an api request' do
2466
- let(:command) { :get_all_contact_tags }
2467
- let(:args) { [(entity = ENTITY_TYPES.sample).sub('company', 'contact'), random_id(entity.to_sym)] }
2468
- end
2469
- end
2470
-
2471
- describe '#add_tag_to_case_group_by_filter' do
2472
- it_should_behave_like 'an api request' do
2473
- let(:command) { :add_tag_to_case_group_by_filter }
2474
- let(:args) { [random_id(:crm_tag)] }
2475
- end
2476
- end
2477
-
2478
- describe '#add_tag_group_to_entity' do
2479
- it_should_behave_like 'an api request' do
2480
- let(:command) { :add_tag_group_to_entity }
2481
- let(:args) { [(entity = ENTITY_TYPES.sample).sub('company', 'contact'), random_id(entity.to_sym), random_id(:crm_tag)] }
2482
- end
2483
- end
2484
-
2485
- describe '#add_tag_to_opportunity_group' do
2486
- it_should_behave_like 'an api request' do
2487
- let(:command) { :add_tag_to_opportunity_group }
2488
- let(:args) { [random_id(:crm_tag)] }
2489
- end
2490
- end
2491
-
2492
- describe '#add_tag' do
2493
- it_should_behave_like 'an api request' do
2494
- let(:command) { :add_tag }
2495
- let(:args) { [(entity = ENTITY_TYPES.sample).sub('company', 'contact'), random_id(entity.to_sym), random_id(:crm_tag)] }
2496
- end
2497
- end
2498
-
2499
- describe '#get_task_template_container_list' do
2500
- it_should_behave_like 'an api request' do
2501
- let(:command) { :get_task_template_container_list }
2502
- let(:args) { [ENTITY_TYPES.sample.sub('company', 'contact')] }
2503
- end
2504
- end
2505
-
2506
- describe '#update_task_template_container' do
2507
- it_should_behave_like 'an api request' do
2508
- let(:command) { :update_task_template_container }
2509
- let(:args) { [random_id(:task_template_container), random_word] }
2510
- let(:add_data_to_collector) { true }
2511
- let(:data_param) { :task_template_container_title_ids }
2512
- let(:param_names) { %w(title) }
2513
- end
2514
- end
2515
-
2516
- describe '#get_task_template_container' do
2517
- it_should_behave_like 'an api request' do
2518
- let(:command) { :get_task_template_container }
2519
- let(:args) { [ENTITY_TYPES.sample.sub('company', 'contact'), random_id(:task_template_container_title)] }
2520
- end
2521
- end
2522
-
2523
- describe '#get_task_template' do
2524
- it_should_behave_like 'an api request' do
2525
- let(:command) { :get_task_template }
2526
- let(:args) { [random_id(:task_template)] }
2527
- end
2528
- end
2529
-
2530
- describe '#get_task_template_list_by_container_id' do
2531
- it_should_behave_like 'an api request' do
2532
- let(:command) { :get_task_template_list_by_container_id }
2533
- let(:args) { [random_id(:task_template_container)] }
2534
- end
2535
- end
2536
-
2537
- describe '#update_task_template' do
2538
- it_should_behave_like 'an api request' do
2539
- let(:command) { :update_task_template }
2540
- i = -1
2541
- let(:args) { [DATA_COLLECTOR[:task_template_container_ids].last, DATA_COLLECTOR[:task_template_ids][i += 1], random_word] }
2542
- end
2543
- end
2544
-
2545
- describe '#get_case_list' do
2546
- it_should_behave_like 'an api request' do
2547
- let(:command) { :get_case_list }
2548
- end
2549
- end
2550
-
2551
- describe '#add_case_contact' do
2552
- it_should_behave_like 'an api request' do
2553
- let(:command) { :add_case_contact }
2554
- i = 3
2555
- let(:args) { [DATA_COLLECTOR[:crm_case_ids][i += 1], DATA_COLLECTOR[:new_contact_ids][i - 4]] }
2556
- end
2557
- end
2558
-
2559
- describe '#get_case_by_id' do
2560
- it_should_behave_like 'an api request' do
2561
- let(:command) { :get_case_by_id }
2562
- let(:args) { [random_id(:crm_case)] }
2563
- end
2564
- end
2565
-
2566
- describe '#get_all_case_contacts' do
2567
- it_should_behave_like 'an api request' do
2568
- let(:command) { :get_all_case_contacts }
2569
- let(:args) { [random_id(:crm_case)] }
2570
- end
2571
- end
2572
-
2573
- describe '#set_case_access_rights' do
2574
- it_should_behave_like 'an api request' do
2575
- let(:command) { :set_case_access_rights }
2576
- let(:args) { [random_id(:crm_case), {isPrivate: random_bool}] }
2577
- end
2578
- end
2579
-
2580
- describe '#update_case' do
2581
- it_should_behave_like 'an api request' do
2582
- let(:command) { :update_case }
2583
- let(:args) { [random_id(:crm_case), random_word] }
2584
- end
2585
- end
2586
-
2587
- describe '#set_case_access_rights_by_filter' do
2588
- it_should_behave_like 'an api request' do
2589
- let(:command) { :set_case_access_rights_by_filter }
2590
- let(:args) { [{contactId: random_id(:new_contact), isPrivate: random_bool}] }
2591
- end
2592
- end
2593
-
2594
- describe '#close_case' do
2595
- it_should_behave_like 'an api request' do
2596
- let(:command) { :close_case }
2597
- i = -1
2598
- let(:args) { [DATA_COLLECTOR[:crm_case_ids][i += 1]] }
2599
- end
2600
- end
2601
-
2602
- describe '#resume_case' do
2603
- it_should_behave_like 'an api request' do
2604
- let(:command) { :resume_case }
2605
- i = -1
2606
- let(:args) { [DATA_COLLECTOR[:crm_case_ids][i += 1]] }
2607
- end
2608
- end
2609
-
2610
- describe '#set_rights_to_case' do
2611
- it_should_behave_like 'an api request' do
2612
- let(:command) { :set_rights_to_case }
2613
- let(:args) { [random_id(:crm_case), isPrivate: random_bool] }
2614
- end
2615
- end
2616
-
2617
- describe '#get_user_field_values' do
2618
- it_should_behave_like 'an api request' do
2619
- let(:command) { :get_user_field_values }
2620
- let(:args) { [(entity = ENTITY_TYPES.sample).sub('company', 'contact'), random_id(entity.to_sym)] }
2621
- end
2622
- end
2623
-
2624
- describe '#get_user_field_list' do
2625
- it_should_behave_like 'an api request' do
2626
- let(:command) { :get_user_field_list }
2627
- let(:args) { [ENTITY_TYPES.sample.sub('company', 'contact')] }
2628
- end
2629
- end
2630
-
2631
- describe '#set_user_field_value' do
2632
- it_should_behave_like 'an api request' do
2633
- let(:command) { :set_user_field_value }
2634
- let(:args) { [ENTITY_TYPES.last, random_id(ENTITY_TYPES.last.to_sym), random_id(:user_field), random_word] }
2635
- end
2636
- end
2637
-
2638
- describe '#update_selected_user_field' do
2639
- it_should_behave_like 'an api request' do
2640
- let(:command) { :update_selected_user_field }
2641
- i = -1
2642
- let(:args) { [ENTITY_TYPES.last, DATA_COLLECTOR[:user_field_ids][i += 1], random_word, rand(6)] }
2643
- let(:add_data_to_collector) { true }
2644
- let(:data_param) { :user_field_title_ids }
2645
- let(:param_names) { %w(label) }
2646
- end
2647
- end
2648
-
2649
- describe '#update_user_fields_order' do
2650
- it_should_behave_like 'an api request' do
2651
- let(:command) { :update_user_fields_order }
2652
- let(:args) { [DATA_COLLECTOR[:user_field_title_ids].sample(rand(1..4))] }
2653
- end
2654
- end
2655
-
2656
- describe '#delete_user_field' do
2657
- it_should_behave_like 'an api request' do
2658
- let(:command) { :delete_user_field }
2659
- let(:args) { [ENTITY_TYPES.last, DATA_COLLECTOR[:user_field_ids].pop] }
2660
- end
2661
- end
2662
-
2663
- describe '#delete_case_contact' do
2664
- it_should_behave_like 'an api request' do
2665
- let(:command) { :delete_case_contact }
2666
- i = -1
2667
- let(:args) { [DATA_COLLECTOR[:crm_case_ids][i += 1], random_id(:new_contact)] }
2668
- end
2669
- end
2670
-
2671
- describe '#delete_case' do
2672
- it_should_behave_like 'an api request' do
2673
- let(:command) { :delete_case }
2674
- let(:args) { [DATA_COLLECTOR[:crm_case_ids].shift] }
2675
- end
2676
- end
2677
-
2678
- describe '#delete_case_group' do
2679
- it_should_behave_like 'an api request' do
2680
- let(:command) { :delete_case_group }
2681
- let(:args) { [DATA_COLLECTOR[:crm_case_ids].pop] }
2682
- end
2683
- end
2684
-
2685
- describe '#delete_case_group_by_filter' do
2686
- it_should_behave_like 'an api request' do
2687
- let(:command) { :delete_case_group }
2688
- i = -1
2689
- let(:args) { [{ contactId: DATA_COLLECTOR[:new_contact_ids][i += 1] }] }
2690
- end
2691
- end
2692
-
2693
- describe '#delete_invoice_item' do
2694
- it_should_behave_like 'an api request' do
2695
- let(:command) { :delete_invoice_item }
2696
- let(:args) { [DATA_COLLECTOR[:invoice_item_ids].pop] }
2697
- end
2698
- end
2699
-
2700
- describe '#delete_invoice_tax' do
2701
- it_should_behave_like 'an api request' do
2702
- let(:command) { :delete_invoice_tax }
2703
- let(:args) { [DATA_COLLECTOR[:invoice_tax_ids].pop] }
2704
- end
2705
- end
2706
-
2707
- describe '#delete_invoice_line' do
2708
- it_should_behave_like 'an api request' do
2709
- pending 'http://bugzserver/show_bug.cgi?id=23886, http://bugzserver/show_bug.cgi?id=23888'
2710
- let(:command) { :delete_invoice_line }
2711
- let(:args) { [DATA_COLLECTOR[:invoice_line_ids].pop] }
2712
- end
2713
- end
2714
-
2715
- describe '#delete_invoice' do
2716
- it_should_behave_like 'an api request' do
2717
- pending 'http://bugzserver/show_bug.cgi?id=23886'
2718
- let(:command) { :delete_invoice }
2719
- let(:args) { [DATA_COLLECTOR[:invoice_ids].pop] }
2720
- end
2721
- end
2722
-
2723
- describe '#delete_opportunity_contact' do
2724
- it_should_behave_like 'an api request' do
2725
- let(:command) { :delete_opportunity_contact }
2726
- i = -1
2727
- let(:args) { [DATA_COLLECTOR[:opportunity_ids].last, DATA_COLLECTOR[:new_contact_ids][i+=1]] }
2728
- end
2729
- end
2730
-
2731
- describe '#delete_batch_invoices' do
2732
- it_should_behave_like 'an api request' do
2733
- pending 'http://bugzserver/show_bug.cgi?id=23886'
2734
- let(:command) { :delete_batch_invoices }
2735
- let(:args) { [[DATA_COLLECTOR[:invoice_ids].pop]] }
2736
- end
2737
- end
2738
-
2739
- describe '#delete_batch_items' do
2740
- it_should_behave_like 'an api request' do
2741
- let(:command) { :delete_batch_items }
2742
- let(:args) { [[DATA_COLLECTOR[:invoice_item_ids].pop]] }
2743
- end
2744
- end
2745
-
2746
- describe '#delete_batch_contacts_by_filter' do
2747
- it_should_behave_like 'an api request' do
2748
- pending 'http://bugzserver/show_bug.cgi?id=23902'
2749
- let(:command) { :delete_batch_contacts_by_filter }
2750
- let(:args) { [{tags: [random_word(4)]}] }
2751
- end
2752
- end
2753
-
2754
- describe '#delete_contact_status' do
2755
- it_should_behave_like 'an api request' do
2756
- pending 'http://bugzserver/show_bug.cgi?id=23915'
2757
- let(:command) { :delete_contact_status }
2758
- let(:args) { [DATA_COLLECTOR[:contact_status_ids].pop] }
2759
- end
2760
- end
2761
-
2762
- describe '#delete_deal_from_contact' do
2763
- it_should_behave_like 'an api request' do
2764
- let(:command) { :delete_deal_from_contact }
2765
- let(:args) { [random_id(:new_contact), random_id(:opportunity)] }
2766
- end
2767
- end
2768
-
2769
- describe '#delete_event_and_related_files' do
2770
- it_should_behave_like 'an api request' do
2771
- let(:command) { :delete_event_and_related_files }
2772
- let(:args) { [DATA_COLLECTOR[:crm_event_ids].pop] }
2773
- end
2774
- end
2775
-
2776
- describe '#delete_history_category' do
2777
- it_should_behave_like 'an api request' do
2778
- let(:command) { :delete_history_category }
2779
- let(:args) { [DATA_COLLECTOR[:crm_history_category_ids].pop] }
2780
- end
2781
- end
2782
-
2783
- describe '#delete_task' do
2784
- it_should_behave_like 'an api request' do
2785
- let(:command) { :delete_task }
2786
- let(:args) { [DATA_COLLECTOR[:crm_task_ids].pop] }
2787
- end
2788
- end
2789
-
2790
- describe '#delete_task_category' do
2791
- it_should_behave_like 'an api request' do
2792
- let(:command) { :delete_task_category }
2793
- let(:args) { [DATA_COLLECTOR[:crm_task_category_ids].pop] }
2794
- end
2795
- end
2796
-
2797
- describe '#delete_person_from_company' do
2798
- it_should_behave_like 'an api request' do
2799
- let(:command) { :delete_person_from_company }
2800
- i = -1
2801
- let(:args) { [ DATA_COLLECTOR[:company_ids].last, DATA_COLLECTOR[:new_contact_ids][i+=1]] }
2802
- end
2803
- end
2804
-
2805
- describe '#delete_contact_address' do
2806
- it_should_behave_like 'an api request' do
2807
- pending 'http://bugzserver/show_bug.cgi?id=24028'
2808
- let(:command) { :delete_contact_address }
2809
- i = -1
2810
- let(:args) { [ DATA_COLLECTOR[:new_contact_ids][i+=1], DATA_COLLECTOR[:contact_address_ids].shift ] }
2811
- end
2812
- end
2813
-
2814
- describe '#remove_contact_from_project' do
2815
- it_should_behave_like 'an api request' do
2816
- let(:command) { :remove_contact_from_project }
2817
- let(:args) { [ random_id(:new_contact), random_id(:project)] }
2818
- end
2819
- end
2820
-
2821
- describe '#delete_contact_type' do
2822
- it_should_behave_like 'an api request' do
2823
- let(:command) { :delete_contact_type }
2824
- let(:args) { [DATA_COLLECTOR[:contact_type_ids].pop] }
2825
- end
2826
- end
2827
-
2828
- describe '#delete_contact_info' do
2829
- it_should_behave_like 'an api request' do
2830
- let(:command) { :delete_contact_info }
2831
- i = -1
2832
- let(:args) { [DATA_COLLECTOR[:new_contact_ids][i+=1], DATA_COLLECTOR[:contact_info_ids][i]] }
2833
- end
2834
- end
2835
-
2836
- describe '#delete_contact_group' do
2837
- it_should_behave_like 'an api request' do
2838
- let(:command) { :delete_contact_group }
2839
- let(:args) { [DATA_COLLECTOR[:new_contact_ids].pop] }
2840
- end
2841
- end
2842
-
2843
- describe '#delete_contact' do
2844
- it_should_behave_like 'an api request' do
2845
- let(:command) { :delete_contact }
2846
- let(:args) { [DATA_COLLECTOR[:new_contact_ids].pop] }
2847
- end
2848
- end
2849
-
2850
- describe '#delete_file' do
2851
- it_should_behave_like 'an api request' do
2852
- let(:command) { :delete_file }
2853
- let(:args) { [DATA_COLLECTOR[:crm_file_ids].pop] }
2854
- end
2855
- end
2856
-
2857
- describe '#delete_tag' do
2858
- it_should_behave_like 'an api request' do
2859
- let(:command) { :delete_tag }
2860
- let(:args) { [ENTITY_TYPES.last, DATA_COLLECTOR[:crm_tag_ids].pop] }
2861
- end
2862
- end
2863
-
2864
- describe '#remove_tag' do
2865
- it_should_behave_like 'an api request' do
2866
- let(:command) { :remove_tag }
2867
- let(:args) { [(entity = ENTITY_TYPES.sample).sub('company', 'contact'), random_id(entity.to_sym), random_id(:crm_tag)] }
2868
- end
2869
- end
2870
-
2871
- describe '#delete_unused_tags' do
2872
- it_should_behave_like 'an api request' do
2873
- let(:command) { :delete_unused_tags }
2874
- let(:args) { [ENTITY_TYPES.sample.sub('company', 'contact')] }
2875
- end
2876
- end
2877
-
2878
- describe '#delete_task_template' do
2879
- it_should_behave_like 'an api request' do
2880
- let(:command) { :delete_task_template }
2881
- let(:args) { [DATA_COLLECTOR[:task_template_ids].pop] }
2882
- end
2883
- end
2884
-
2885
- describe '#delete_task_template_container' do
2886
- it_should_behave_like 'an api request' do
2887
- let(:command) { :delete_task_template_container }
2888
- let(:args) { [DATA_COLLECTOR[:task_template_container_ids].pop] }
2889
- end
2890
- end
2891
-
2892
- describe '#delete_opportunity_group' do
2893
- it_should_behave_like 'an api request' do
2894
- let(:command) { :delete_opportunity_group }
2895
- let(:args) { [DATA_COLLECTOR[:opportunity_ids].pop] }
2896
- end
2897
- end
2898
-
2899
- describe '#delete_opportunity' do
2900
- it_should_behave_like 'an api request' do
2901
- let(:command) { :delete_opportunity }
2902
- let(:args) { [DATA_COLLECTOR[:opportunity_ids].pop] }
2903
- end
2904
- end
2905
-
2906
- describe '#delete_opportunity_group_by_filter' do
2907
- it_should_behave_like 'an api request' do
2908
- let(:command) { :delete_opportunity_group_by_filter }
2909
- end
2910
- end
2911
-
2912
- describe '#delete_opportunity_stage' do
2913
- it_should_behave_like 'an api request' do
2914
- let(:command) { :delete_opportunity_stage }
2915
- let(:args) { [DATA_COLLECTOR[:opportunity_stage_ids].pop] }
2916
- end
2917
- end
2918
- end
2919
-
2920
- describe '[Community]' do
2921
-
2922
- let(:teamlab_module) { :community }
2923
-
2924
- describe '#create_project' do
2925
- it_should_behave_like 'an api request' do
2926
- let(:command) { :create_post }
2927
- let(:args) { [random_word, random_word] }
2928
- let(:add_data_to_collector) { true }
2929
- let(:data_param) { :community_post_ids }
2930
- let(:param_names) { %w(id) }
2931
- end
2932
- end
2933
-
2934
- describe '#add_comment' do
2935
- it_should_behave_like 'an api request' do
2936
- let(:command) { :create_post }
2937
- let(:args) { [random_id(:community_post), random_word] }
2938
- let(:add_data_to_collector) { true }
2939
- let(:data_param) { :community_post_comment_ids }
2940
- let(:param_names) { %w(id) }
2941
- end
2942
- end
2943
-
2944
- describe '#add_bookmark' do
2945
- it_should_behave_like 'an api request' do
2946
- let(:command) { :add_bookmark }
2947
- let(:args) { [SOME_URL, random_word, {tags: [random_word(4), random_word(4), random_word(4)].join(', ')}] }
2948
- let(:add_data_to_collector) { true }
2949
- let(:data_param) { :bookmark_ids }
2950
- let(:param_names) { %w(id) }
2951
- end
2952
- end
2953
-
2954
- describe '#add_comment_to_bookmark' do
2955
- it_should_behave_like 'an api request' do
2956
- let(:command) { :add_comment_to_bookmark }
2957
- let(:args) { [random_id(:bookmark), random_word] }
2958
- let(:add_data_to_collector) { true }
2959
- let(:data_param) { :bookmark_comment_ids }
2960
- let(:param_names) { %w(id) }
2961
- end
2962
- end
2963
-
2964
- describe '#create_event' do
2965
- it_should_behave_like 'an api request' do
2966
- let(:command) { :create_event }
2967
- let(:args) { [random_word, random_word] }
2968
- let(:add_data_to_collector) { true }
2969
- let(:data_param) { :event_ids }
2970
- let(:param_names) { %w(id) }
2971
- end
2972
- end
2973
-
2974
- describe '#create_poll' do
2975
- it_should_behave_like 'an api request' do
2976
- let(:command) { :create_event }
2977
- let(:args) { [random_word, random_word, {type: 'Poll'}] }
2978
- let(:add_data_to_collector) { true }
2979
- let(:data_param) { :poll_ids }
2980
- let(:param_names) { %w(id) }
2981
- end
2982
- end
2983
-
2984
- describe '#add_thread_to_category' do
2985
- it_should_behave_like 'an api request' do
2986
- pending 'http://bugzserver/show_bug.cgi?id=24054'
2987
- let(:command) { :add_thread_to_category }
2988
- let(:args) { [-1, random_word, random_word, random_word] }
2989
- let(:add_data_to_collector) { true }
2990
- let(:data_param) { :thread_ids }
2991
- let(:param_names) { %w(id) }
2992
- end
2993
- end
2994
-
2995
- describe '#add_topic_to_thread' do
2996
- it_should_behave_like 'an api request' do
2997
- pending 'http://bugzserver/show_bug.cgi?id=24054'
2998
- let(:command) { :add_topic_to_thread }
2999
- let(:args) { [random_id(:thread), random_word, random_word] }
3000
- let(:add_data_to_collector) { true }
3001
- let(:data_param) { :thread_topic_ids }
3002
- let(:param_names) { %w(id) }
3003
- end
3004
- end
3005
-
3006
- describe '#add_post_to_topic' do
3007
- it_should_behave_like 'an api request' do
3008
- pending 'http://bugzserver/show_bug.cgi?id=24054'
3009
- let(:command) { :add_post_to_topic }
3010
- let(:args) { [DATA_COLLECTOR[:thread_topic_ids].last, random_word, random_word] }
3011
- let(:add_data_to_collector) { true }
3012
- let(:data_param) { :topic_post_ids }
3013
- let(:param_names) { %w(id) }
3014
- end
3015
- end
3016
-
3017
- describe '#create_page' do
3018
- it_should_behave_like 'an api request' do
3019
- let(:command) { :create_page }
3020
- let(:args) { [random_word, random_word] }
3021
- let(:add_data_to_collector) { true }
3022
- let(:data_param) { :wiki_page_name_ids }
3023
- let(:param_names) { %w(name) }
3024
- end
3025
- end
3026
-
3027
- describe '#create_wiki_page_comment' do
3028
- it_should_behave_like 'an api request' do
3029
- let(:command) { :create_wiki_page_comment }
3030
- let(:args) { [random_id(:wiki_page_name), random_word] }
3031
- let(:add_data_to_collector) { true }
3032
- let(:data_param) { :wiki_page_comment_ids }
3033
- let(:param_names) { %w(id) }
3034
- end
3035
- end
3036
-
3037
- describe '#upload_files' do
3038
- it_should_behave_like 'an api request' do
3039
- let(:command) { :upload_files }
3040
- let(:args) { [random_id(:wiki_pages_name), FILES_TO_UPLOAD] }
3041
- let(:add_data_to_collector) { true }
3042
- let(:data_param) { :wiki_page_file_name_ids }
3043
- let(:param_names) { %w(name) }
3044
- end
3045
- end
3046
-
3047
- describe '#update_post' do
3048
- it_should_behave_like 'an api request' do
3049
- let(:command) { :update_post }
3050
- let(:args) { [random_id(:community_post), random_word, random_word, {tags: [random_word(4), random_word(4), random_word(4)].join(',')}] }
3051
- end
3052
- end
3053
-
3054
- describe '#get_all_posts' do
3055
- it_should_behave_like 'an api request' do
3056
- let(:command) { :get_all_posts }
3057
- end
3058
- end
3059
-
3060
- describe '#get_blog_tags' do
3061
- it_should_behave_like 'an api request' do
3062
- let(:command) { :get_blog_tags }
3063
- end
3064
- end
3065
-
3066
- describe '#get_my_posts' do
3067
- it_should_behave_like 'an api request' do
3068
- let(:command) { :get_my_posts }
3069
- end
3070
- end
3071
-
3072
- describe '#get_post_by_id' do
3073
- it_should_behave_like 'an api request' do
3074
- let(:command) { :get_post }
3075
- let(:args) { [random_id(:community_post)] }
3076
- end
3077
- end
3078
-
3079
- describe '#get_posts_by_tag' do
3080
- it_should_behave_like 'an api request' do
3081
- let(:command) { :get_posts_by_tag }
3082
- let(:args) { [random_word(4)] }
3083
- end
3084
- end
3085
-
3086
- describe '#search_posts' do
3087
- it_should_behave_like 'an api request' do
3088
- let(:command) { :search_posts }
3089
- let(:args) { [random_word] }
3090
- end
3091
- end
3092
-
3093
- describe '#get_user_posts' do
3094
- it_should_behave_like 'an api request' do
3095
- let(:command) { :get_user_posts }
3096
- let(:args) { [DATA_COLLECTOR[:self_username].sample] }
3097
- end
3098
- end
3099
-
3100
- describe '#get_comments' do
3101
- it_should_behave_like 'an api request' do
3102
- let(:command) { :get_comments }
3103
- let(:args) { [random_id(:community_post)] }
3104
- end
3105
- end
3106
-
3107
- describe '#get_all_bookmarks' do
3108
- it_should_behave_like 'an api request' do
3109
- let(:command) { :get_all_bookmarks }
3110
- end
3111
- end
3112
-
3113
- describe '#get_all_bookmark_tags' do
3114
- it_should_behave_like 'an api request' do
3115
- let(:command) { :get_all_bookmark_tags }
3116
- end
3117
- end
3118
-
3119
- describe '#get_bookmark' do
3120
- it_should_behave_like 'an api request' do
3121
- let(:command) { :get_bookmark }
3122
- let(:args) { [random_id(:bookmark)] }
3123
- end
3124
- end
3125
-
3126
- describe '#get_bookmarks_added_by_me' do
3127
- it_should_behave_like 'an api request' do
3128
- let(:command) { :get_bookmarks_added_by_me }
3129
- end
3130
- end
3131
-
3132
- describe '#get_my_favourite_bookmarks' do
3133
- it_should_behave_like 'an api request' do
3134
- let(:command) { :get_my_favourite_bookmarks }
3135
- end
3136
- end
3137
-
3138
- describe '#get_top_of_day_bookmarks' do
3139
- it_should_behave_like 'an api request' do
3140
- let(:command) { :get_top_of_day_bookmarks }
3141
- end
3142
- end
3143
-
3144
- describe '#get_top_of_week_bookmarks' do
3145
- it_should_behave_like 'an api request' do
3146
- let(:command) { :get_top_of_week_bookmarks }
3147
- end
3148
- end
3149
-
3150
- describe '#get_top_of_month_bookmarks' do
3151
- it_should_behave_like 'an api request' do
3152
- let(:command) { :get_top_of_month_bookmarks }
3153
- end
3154
- end
3155
-
3156
- describe '#get_top_of_year_bookmarks' do
3157
- it_should_behave_like 'an api request' do
3158
- let(:command) { :get_top_of_year_bookmarks }
3159
- end
3160
- end
3161
-
3162
- describe '#get_bookmarks_by_tag' do
3163
- it_should_behave_like 'an api request' do
3164
- let(:command) { :get_bookmarks_by_tag }
3165
- let(:args) { [random_word(4)] }
3166
- end
3167
- end
3168
-
3169
- describe '#get_recently_added_bookmarks' do
3170
- it_should_behave_like 'an api request' do
3171
- let(:command) { :get_recently_added_bookmarks }
3172
- end
3173
- end
3174
-
3175
- describe '#get_bookmark_comments' do
3176
- it_should_behave_like 'an api request' do
3177
- let(:command) { :get_bookmark_comments }
3178
- let(:args) { [random_id(:bookmark)] }
3179
- end
3180
- end
3181
-
3182
- describe '#search_bookmarks' do
3183
- it_should_behave_like 'an api request' do
3184
- let(:command) { :search_bookmarks }
3185
- let(:args) { [random_word] }
3186
- end
3187
- end
3188
-
3189
- describe '#update_event' do
3190
- it_should_behave_like 'an api request' do
3191
- let(:command) { :update_event }
3192
- let(:args) { [random_id(:event), random_word, random_word] }
3193
- end
3194
- end
3195
-
3196
- describe '#get_all_events' do
3197
- it_should_behave_like 'an api request' do
3198
- let(:command) { :get_all_events }
3199
- end
3200
- end
3201
-
3202
- describe '#get_my_events' do
3203
- it_should_behave_like 'an api request' do
3204
- let(:command) { :get_my_events }
3205
- end
3206
- end
3207
-
3208
- describe '#get_event' do
3209
- it_should_behave_like 'an api request' do
3210
- let(:command) { :get_event }
3211
- let(:args) { [random_id(:event)] }
3212
- end
3213
- end
3214
-
3215
- describe '#search_events' do
3216
- it_should_behave_like 'an api request' do
3217
- let(:command) { :search_events }
3218
- let(:args) { [random_word] }
3219
- end
3220
- end
3221
-
3222
- describe '#vote_for_event' do
3223
- it_should_behave_like 'an api request' do
3224
- let(:command) { :vote_for_event }
3225
- let(:args) { [random_id(:poll), rand(2)] }
3226
- end
3227
- end
3228
-
3229
- describe '#add_comment_to_event' do
3230
- it_should_behave_like 'an api request' do
3231
- let(:command) { :add_comment_to_event }
3232
- let(:args) { [random_id(:event), random_word] }
3233
- end
3234
- end
3235
-
3236
- describe '#get_forums' do
3237
- it_should_behave_like 'an api request' do
3238
- let(:command) { :get_forums }
3239
- end
3240
- end
3241
-
3242
- describe '#get_thread_topics' do
3243
- it_should_behave_like 'an api request' do
3244
- pending 'http://bugzserver/show_bug.cgi?id=24054'
3245
- let(:command) { :get_thread_topics }
3246
- let(:args) { [random_id(:thread)] }
3247
- end
3248
- end
3249
-
3250
- describe '#get_last_updated_topics' do
3251
- it_should_behave_like 'an api request' do
3252
- let(:command) { :get_last_updated_topics }
3253
- end
3254
- end
3255
-
3256
- describe '#get_posts' do
3257
- it_should_behave_like 'an api request' do
3258
- pending 'http://bugzserver/show_bug.cgi?id=24054'
3259
- let(:command) { :get_posts }
3260
- let(:args) { [random_id(:thread_topic)] }
3261
- end
3262
- end
3263
-
3264
- describe '#search_topics' do
3265
- it_should_behave_like 'an api request' do
3266
- let(:command) { :search_topics }
3267
- let(:args) { [random_word(5)] }
3268
- end
3269
- end
3270
-
3271
- describe '#update_topic_in_thread' do
3272
- it_should_behave_like 'an api request' do
3273
- pending 'http://bugzserver/show_bug.cgi?id=24054'
3274
- let(:command) { :update_topic_in_thread }
3275
- let(:args) { [random_id(:thread_topic), random_word, random_word] }
3276
- end
3277
- end
3278
-
3279
- describe '#update_post_in_topic' do
3280
- it_should_behave_like 'an api request' do
3281
- pending 'http://bugzserver/show_bug.cgi?id=24054'
3282
- let(:command) { :update_post_in_topic }
3283
- let(:args) { [DATA_COLLECTOR[:thread_topic_ids].last, random_id(:topic_post)] }
3284
- end
3285
- end
3286
-
3287
- describe '#get_wiki_pages' do
3288
- it_should_behave_like 'an api request' do
3289
- let(:command) { :get_wiki_pages }
3290
- end
3291
- end
3292
-
3293
- describe '#get_wiki_page' do
3294
- it_should_behave_like 'an api request' do
3295
- let(:command) { :get_wiki_page }
3296
- let(:args) { [random_id(:wiki_page_name)] }
3297
- end
3298
- end
3299
-
3300
- describe '#get_wiki_file_info' do
3301
- it_should_behave_like 'an api request' do
3302
- let(:command) { :get_wiki_file_info }
3303
- let(:args) { [random_id(:wiki_page_file_name)] }
3304
- end
3305
- end
3306
-
3307
- describe '#get_page_history' do
3308
- it_should_behave_like 'an api request' do
3309
- let(:command) { :get_page_history }
3310
- let(:args) { [random_id(:wiki_page_name)] }
3311
- end
3312
- end
3313
-
3314
- describe '#get_all_page_comments' do
3315
- it_should_behave_like 'an api request' do
3316
- let(:command) { :get_all_page_comments }
3317
- let(:args) { [random_id(:wiki_page_name)] }
3318
- end
3319
- end
3320
-
3321
- describe '#search_wiki_pages_by_name' do
3322
- it_should_behave_like 'an api request' do
3323
- let(:command) { :search_wiki_pages_by_name }
3324
- let(:args) { [random_word] }
3325
- end
3326
- end
3327
-
3328
- describe '#search_wiki_pages_by_content' do
3329
- it_should_behave_like 'an api request' do
3330
- let(:command) { :search_wiki_pages_by_content }
3331
- let(:args) { [random_word] }
3332
- end
3333
- end
3334
-
3335
- describe '#update_wiki_page' do
3336
- it_should_behave_like 'an api request' do
3337
- let(:command) { :update_wiki_page }
3338
- let(:args) { [random_id(:wiki_page_name), random_word] }
3339
- end
3340
- end
3341
-
3342
- describe '#update_wiki_page_comment' do
3343
- it_should_behave_like 'an api request' do
3344
- let(:command) { :update_wiki_page_comment }
3345
- let(:args) { [random_id(:wiki_page_comment), random_word] }
3346
- end
3347
- end
3348
-
3349
- describe '#delete_post' do
3350
- it_should_behave_like 'an api request' do
3351
- let(:command) { :delete_post }
3352
- let(:args) { [DATA_COLLECTOR[:community_post_ids].pop] }
3353
- end
3354
- end
3355
-
3356
- describe '#delete_post_in_topic' do
3357
- it_should_behave_like 'an api request' do
3358
- pending 'http://bugzserver/show_bug.cgi?id=24054'
3359
- let(:command) { :delete_post_in_topic }
3360
- let(:args) { [DATA_COLLECTOR[:thread_topic_ids].last, DATA_COLLECTOR[:topic_post_ids].pop] }
3361
- end
3362
- end
3363
-
3364
- describe '#delete_wiki_page_comment' do
3365
- it_should_behave_like 'an api request' do
3366
- let(:command) { :delete_wiki_page_comment }
3367
- let(:args) { [DATA_COLLECTOR[:wiki_page_comment_ids].pop] }
3368
- end
3369
- end
3370
-
3371
- describe '#delete_wiki_file' do
3372
- it_should_behave_like 'an api request' do
3373
- let(:command) { :delete_wiki_file }
3374
- let(:args) { [DATA_COLLECTOR[:wiki_page_file_name_ids].pop] }
3375
- end
3376
- end
3377
-
3378
- describe '#delete_wiki_page' do
3379
- it_should_behave_like 'an api request' do
3380
- let(:command) { :delete_wiki_page }
3381
- let(:args) { [DATA_COLLECTOR[:wiki_page_name_ids].pop] }
3382
- end
3383
- end
3384
- end
3385
-
3386
- describe '[Calendar]' do
3387
-
3388
- let(:teamlab_module) { :calendar }
3389
-
3390
- describe '#create_calendar' do
3391
- it_should_behave_like 'an api request' do
3392
- let(:command) { :create_calendar }
3393
- let(:args) { [random_word, TIME_ZONES.sample] }
3394
- let(:add_data_to_collector) { true }
3395
- let(:data_param) { :calendar_ids }
3396
- let(:param_names) { %w(objectId) }
3397
- end
3398
- end
3399
-
3400
- describe '#get_icalc_link' do
3401
- it_should_behave_like 'an api request' do
3402
- let(:command) { :get_icalc_link }
3403
- i = -1
3404
- let(:args) { [DATA_COLLECTOR[:calendar_ids][i += 1]] }
3405
- let(:add_data_to_collector) { true }
3406
- let(:data_param) { :ical_link_ids }
3407
- let(:param_names) { %w() }
3408
- end
3409
- end
3410
-
3411
- describe '#create_calendar_by_ical_link' do
3412
- it_should_behave_like 'an api request' do
3413
- let(:command) { :create_calendar_by_ical_link }
3414
- let(:args) { [random_id(:ical_link)] }
3415
- let(:add_data_to_collector) { true }
3416
- let(:data_param) { :calendar_ids }
3417
- let(:param_names) { %w(objectId) }
3418
- end
3419
- end
3420
-
3421
- describe '#add_event' do
3422
- it_should_behave_like 'an api request' do
3423
- pending 'http://bugzserver/show_bug.cgi?id=24071'
3424
- let(:command) { :add_event }
3425
- i = -1
3426
- let(:args) { [DATA_COLLECTOR[:calendar_ids][i += 1], random_word] }
3427
- let(:add_data_to_collector) { true }
3428
- let(:data_param) { :event_ids }
3429
- let(:param_names) { %w(id) }
3430
- end
3431
- end
3432
-
3433
- describe '#get_default_access' do
3434
- it_should_behave_like 'an api request' do
3435
- let(:command) { :get_default_access }
3436
- end
3437
- end
3438
-
3439
- describe '#get_calendar' do
3440
- it_should_behave_like 'an api request' do
3441
- let(:command) { :get_calendar }
3442
- let(:args) { [random_id(:calendar)] }
3443
- end
3444
- end
3445
-
3446
- describe '#get_subscription_list' do
3447
- it_should_behave_like 'an api request' do
3448
- let(:command) { :get_subscription_list }
3449
- end
3450
- end
3451
-
3452
- describe '#get_access_parameters' do
3453
- it_should_behave_like 'an api request' do
3454
- let(:command) { :get_access_parameters }
3455
- let(:args) { [random_id(:calendar)] }
3456
- end
3457
- end
3458
-
3459
- describe '#get_icalc_feed' do
3460
- it_should_behave_like 'an api request' do
3461
- pending 'Выкачивает .ics файл. Response в IDE выглядит извращенно'
3462
- let(:command) { :get_icalc_feed }
3463
- i = -1
3464
- let(:args) { [DATA_COLLECTOR[:calendar_ids][i += 1], DATA_COLLECTOR[:ical_link_ids][i].split('/').last] }
3465
- end
3466
- end
3467
-
3468
- describe '#get_calendar_events' do
3469
- it_should_behave_like 'an api request' do
3470
- pending 'http://bugzserver/show_bug.cgi?id=24069'
3471
- let(:command) { :get_calendar_events }
3472
- let(:args) { [DateTime.commercial(2014).to_s, DateTime.commercial(2015).to_s] }
3473
- end
3474
- end
3475
-
3476
- describe '#get_calendars_and_subscriptions' do
3477
- it_should_behave_like 'an api request' do
3478
- pending 'http://bugzserver/show_bug.cgi?id=24069'
3479
- let(:command) { :get_calendars_and_subscriptions }
3480
- let(:args) { [DateTime.commercial(2014).to_s, DateTime.commercial(2015).to_s] }
3481
- end
3482
- end
3483
-
3484
- describe '#create_calendar_by_ical_link' do
3485
- it_should_behave_like 'an api request' do
3486
- let(:command) { :create_calendar_by_ical_link } #ХЗ ГДЕ ВЗЯТЬ ЛИНКУ
3487
- let(:args) { [random_id(:ical_link), random_word] }
3488
- end
3489
- end
3490
-
3491
- describe '#import_ical' do
3492
- it_should_behave_like 'an api request' do
3493
- let(:command) { :import_ical }
3494
- let(:args) { [random_id(:calendar), CALENDAR_TO_UPLOAD] }
3495
- end
3496
- end
3497
-
3498
- describe '#update_calendar' do
3499
- it_should_behave_like 'an api request' do
3500
- let(:command) { :update_calendar }
3501
- let(:args) { [random_id(:calendar), random_word, TIME_ZONES.sample] }
3502
- end
3503
- end
3504
-
3505
- describe '#update_calendar_user_view' do
3506
- it_should_behave_like 'an api request' do
3507
- let(:command) { :update_calendar_user_view }
3508
- let(:args) { [random_id(:calendar), random_word, TIME_ZONES.sample] }
3509
- end
3510
- end
3511
-
3512
- describe '#manage_subscriptions' do
3513
- it_should_behave_like 'an api request' do
3514
- pending 'http://bugzserver/show_bug.cgi?id=24072'
3515
- let(:command) { :manage_subscriptions }
3516
- let(:args) { [[random_word]] }
3517
- end
3518
- end
3519
-
3520
- describe '#update_event' do
3521
- it_should_behave_like 'an api request' do
3522
- pending 'http://bugzserver/show_bug.cgi?id=24071'
3523
- let(:command) { :update_event }
3524
- i = -1
3525
- let(:args) { [DATA_COLLECTOR[:calendar_ids][i += 1], DATA_COLLECTOR[:event_ids][i], random_word] }
3526
- end
3527
- end
3528
-
3529
- describe '#unsubscribe_from_event' do
3530
- it_should_behave_like 'an api request' do
3531
- let(:command) { :unsubscribe_from_event }
3532
- let(:args) { [random_id(:event)] }
3533
- end
3534
- end
3535
-
3536
- describe '#remove_event' do
3537
- it_should_behave_like 'an api request' do
3538
- let(:command) { :remove_event }
3539
- let(:args) { [random_id(:event)] }
3540
- end
3541
- end
3542
-
3543
- describe '#delete_event_series' do
3544
- it_should_behave_like 'an api request' do
3545
- let(:command) { :delete_event_series }
3546
- let(:args) { [DATA_COLLECTOR[:event_ids].pop] }
3547
- end
3548
- end
3549
-
3550
- describe '#delete_calendar' do
3551
- it_should_behave_like 'an api request' do
3552
- let(:command) { :delete_calendar }
3553
- let(:args) { [DATA_COLLECTOR[:calendar_ids].pop] }
3554
- end
3555
- end
3556
- end
3557
-
3558
- describe '[Mail]' do
3559
-
3560
- let(:teamlab_module) { :mail }
3561
-
3562
- describe '#create_tag' do
3563
- it_should_behave_like 'an api request' do
3564
- let(:command) { :create_tag }
3565
- let(:args) { [random_word(4), {style: rand(15)}] }
3566
- end
3567
- end
3568
-
3569
- describe '#create_account_by_email' do
3570
- it_should_behave_like 'an api request' do
3571
- let(:command) { :create_account_by_email }
3572
- let(:args) { [USERNAME, PASSWORD] }
3573
- end
3574
- end
3575
-
3576
-
3577
-
3578
-
3579
-
3580
- ########################################################################################################################
3581
- ############################################# END CREATING #############################################################
3582
- ########################################################################################################################
3583
-
3584
- describe '#get_filtered_messages' do
3585
- it_should_behave_like 'an api request' do
3586
- let(:command) { :get_filtered_messages }
3587
- let(:args) { [2] }
3588
- end
3589
- end
3590
-
3591
- describe '#get_message' do
3592
- it_should_behave_like 'an api request' do
3593
- let(:command) { :get_message }
3594
- let(:args) {message_id}
3595
- end
3596
- end
3597
-
3598
- describe '#get_message_template' do
3599
- it_should_behave_like 'an api request' do
3600
- let(:command) { :get_message_template }
3601
- end
3602
- end
3603
-
3604
- describe '#get_account_list' do
3605
- it_should_behave_like 'an api request' do
3606
- let(:command) { :get_account_list }
3607
- end
3608
- end
3609
-
3610
- describe '#get_tag_list' do
3611
- it_should_behave_like 'an api request' do
3612
- let(:command) { :get_tag_list }
3613
- end
3614
- end
3615
-
3616
-
3617
-
3618
- ########################################################################################################################
3619
- ############################################### DELETING ###############################################################
3620
- ########################################################################################################################
3621
- end
3622
-
3623
- describe 'Cleaning enviroment' do
3624
-
3625
- describe '#delete_file' do
83
+ describe '#delete_file' do
3626
84
  it_should_behave_like 'an api request' do
3627
85
  let(:teamlab_module) { :files }
3628
86
  let(:command) { :delete_file }
@@ -3630,14 +88,6 @@ describe Teamlab do
3630
88
  end
3631
89
  end
3632
90
 
3633
- describe '#delete_user' do
3634
- it_should_behave_like 'an api request' do
3635
- let(:teamlab_module) { :people }
3636
- let(:command) { :delete_user }
3637
- let(:args) { [DATA_COLLECTOR[:user_ids].pop] }
3638
- end
3639
- end
3640
-
3641
91
  describe '#delete_contact' do
3642
92
  it_should_behave_like 'an api request' do
3643
93
  let(:teamlab_module) { :crm }