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.
- checksums.yaml +4 -4
- data/Changelog.md +4 -0
- data/lib/teamlab/Modules/Settings.rb +12 -0
- data/lib/teamlab/Response.rb +12 -6
- data/lib/teamlab/version.rb +1 -1
- data/spec/lib/Teamlab_spec.rb +2 -3552
- data/spec/lib/calendar_spec.rb +175 -0
- data/spec/lib/community_spec.rb +475 -0
- data/spec/lib/crm_spec.rb +1439 -0
- data/spec/lib/data/basic.ics +11 -0
- data/spec/lib/data/docx_file.docx +0 -0
- data/spec/lib/files_spec.rb +319 -0
- data/spec/lib/group_spec.rb +96 -0
- data/spec/lib/mail_spec.rb +60 -0
- data/spec/lib/people_spec.rb +164 -0
- data/spec/lib/project_spec.rb +800 -0
- data/spec/lib/settings_spec.rb +118 -0
- data/spec/spec_helper.rb +37 -2
- data/spec/support/http_data.rb +5 -27
- metadata +24 -2
@@ -0,0 +1,800 @@
|
|
1
|
+
require_relative '../spec_helper'
|
2
|
+
|
3
|
+
describe '[Project]' do
|
4
|
+
|
5
|
+
before :all do
|
6
|
+
Teamlab.configure do |config|
|
7
|
+
config.server = SERVER
|
8
|
+
config.username = USERNAME
|
9
|
+
config.password = PASSWORD
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
let(:teamlab_module) { :project }
|
14
|
+
|
15
|
+
describe '#add_user' do
|
16
|
+
it_should_behave_like 'an api request' do
|
17
|
+
let(:teamlab_module) { :people }
|
18
|
+
let(:command) { :add_user }
|
19
|
+
let(:args) { [false, random_email, random_word.capitalize, random_word.capitalize] }
|
20
|
+
let(:add_data_to_collector) { true }
|
21
|
+
let(:data_param) { :user_ids }
|
22
|
+
let(:param_names) { %w(id) }
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
describe '#create_project' do
|
27
|
+
it_should_behave_like 'an api request' do
|
28
|
+
let(:teamlab_module) { :project }
|
29
|
+
let(:command) { :create_project }
|
30
|
+
let(:args) { [random_word, random_word, random_id(:user), random_word(3), random_bool] }
|
31
|
+
let(:add_data_to_collector) { true }
|
32
|
+
let(:data_param) { :project_ids }
|
33
|
+
let(:param_names) { %w(id) }
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
describe '#get_my_files' do
|
38
|
+
it_should_behave_like 'an api request' do
|
39
|
+
let(:teamlab_module) { :files }
|
40
|
+
let(:command) { :get_my_files }
|
41
|
+
let(:add_data_to_collector) { true }
|
42
|
+
let(:data_param) { :my_documents_ids }
|
43
|
+
let(:param_names) { %w(current id) }
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
describe '#create_file' do
|
48
|
+
it_should_behave_like 'an api request' do
|
49
|
+
let(:teamlab_module) { :files }
|
50
|
+
let(:command) { :create_file }
|
51
|
+
let(:args) { [random_id(:my_documents), random_word] }
|
52
|
+
let(:add_data_to_collector) { true }
|
53
|
+
let(:data_param) { :file_ids }
|
54
|
+
let(:param_names) { %w(id) }
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
58
|
+
describe '#add_importing_url_to_queue' do
|
59
|
+
it_should_behave_like 'an api request' do
|
60
|
+
let(:command) { :add_importing_url_to_queue }
|
61
|
+
let(:args) { [BASECAMP_URL, BASECAMP_LOGIN, BASECAMP_PSW, IMPORT_CLOSED_PROJECTS, DISABLE_NOTIFICATONS, IMPORT_USERS_AS_COLLABORATORS] }
|
62
|
+
end
|
63
|
+
end
|
64
|
+
|
65
|
+
describe '#get_projects_for_import' do
|
66
|
+
it_should_behave_like 'an api request' do
|
67
|
+
let(:command) { :get_projects_for_import }
|
68
|
+
let(:args) { [BASECAMP_URL, BASECAMP_LOGIN, BASECAMP_PSW] }
|
69
|
+
end
|
70
|
+
end
|
71
|
+
|
72
|
+
describe '#get_import_status' do
|
73
|
+
it_should_behave_like 'an api request' do
|
74
|
+
let(:command) { :get_import_status }
|
75
|
+
end
|
76
|
+
end
|
77
|
+
|
78
|
+
describe '#create_project' do
|
79
|
+
it_should_behave_like 'an api request' do
|
80
|
+
let(:command) { :create_project }
|
81
|
+
let(:args) { [random_word, random_word, random_id(:user), random_word(3), random_bool, {participants: DATA_COLLECTOR[:user_ids]}] }
|
82
|
+
let(:add_data_to_collector) { true }
|
83
|
+
let(:data_param) { :new_project_ids }
|
84
|
+
let(:param_names) { %w(id) }
|
85
|
+
end
|
86
|
+
end
|
87
|
+
|
88
|
+
describe '#add_message' do
|
89
|
+
it_should_behave_like 'an api request' do
|
90
|
+
let(:command) { :add_message }
|
91
|
+
let(:args) { [random_id(:new_project), random_word, random_word, DATA_COLLECTOR[:user_ids].join(',')] }
|
92
|
+
let(:add_data_to_collector) { true }
|
93
|
+
let(:data_param) { :discussion_ids }
|
94
|
+
let(:param_names) { %w(id) }
|
95
|
+
end
|
96
|
+
end
|
97
|
+
|
98
|
+
describe '#create_template' do
|
99
|
+
it_should_behave_like 'an api request' do
|
100
|
+
let(:command) { :create_template }
|
101
|
+
let(:args) { [random_word] }
|
102
|
+
let(:add_data_to_collector) { true }
|
103
|
+
let(:data_param) { :project_template_ids }
|
104
|
+
let(:param_names) { %w(id) }
|
105
|
+
end
|
106
|
+
end
|
107
|
+
|
108
|
+
describe '#add_task' do
|
109
|
+
it_should_behave_like 'an api request' do
|
110
|
+
let(:command) { :add_task }
|
111
|
+
let(:args) { [random_id(:new_project), random_word] }
|
112
|
+
let(:add_data_to_collector) { true }
|
113
|
+
let(:data_param) { :project_task_ids }
|
114
|
+
let(:param_names) { %w(id) }
|
115
|
+
end
|
116
|
+
end
|
117
|
+
|
118
|
+
describe '#add_task_from_discussion' do
|
119
|
+
it_should_behave_like 'an api request' do
|
120
|
+
let(:command) { :add_task_from_discussion }
|
121
|
+
let(:args) { [random_id(:new_project), random_id(:discussion)] }
|
122
|
+
end
|
123
|
+
end
|
124
|
+
|
125
|
+
describe '#create_subtask' do
|
126
|
+
it_should_behave_like 'an api request' do
|
127
|
+
let(:command) { :create_subtask }
|
128
|
+
let(:args) { [DATA_COLLECTOR[:project_task_ids].last, random_id(:user), random_word] }
|
129
|
+
let(:add_data_to_collector) { true }
|
130
|
+
let(:data_param) { :project_subtask_ids }
|
131
|
+
let(:param_names) { %w(id) }
|
132
|
+
end
|
133
|
+
end
|
134
|
+
|
135
|
+
describe '#add_task_time' do
|
136
|
+
it_should_behave_like 'an api request' do
|
137
|
+
let(:command) { :add_task_time }
|
138
|
+
let(:args) { [random_id(:project_task), Time.now.strftime('%Y-%m-%-d'), random_id(:user), DATA_COLLECTOR[:new_project_ids].last] }
|
139
|
+
let(:add_data_to_collector) { true }
|
140
|
+
let(:data_param) { :project_task_time_ids }
|
141
|
+
let(:param_names) { %w(id) }
|
142
|
+
end
|
143
|
+
end
|
144
|
+
|
145
|
+
describe '#upload_file_to_task' do
|
146
|
+
it_should_behave_like 'an api request' do
|
147
|
+
let(:command) { :upload_file_to_task }
|
148
|
+
let(:args) { [random_id(:project_task), [random_id(:file)]] }
|
149
|
+
end
|
150
|
+
end
|
151
|
+
|
152
|
+
describe '#upload_file_to_message' do
|
153
|
+
it_should_behave_like 'an api request' do
|
154
|
+
let(:command) { :upload_file_to_message }
|
155
|
+
let(:args) { [random_id(:discussion), [random_id(:file)]] }
|
156
|
+
end
|
157
|
+
end
|
158
|
+
|
159
|
+
describe '#add_milestone' do
|
160
|
+
it_should_behave_like 'an api request' do
|
161
|
+
let(:command) { :add_milestone }
|
162
|
+
let(:args) { [random_id(:new_project), random_word, DateTime.commercial(2015).to_s, random_id(:user)] }
|
163
|
+
let(:add_data_to_collector) { true }
|
164
|
+
let(:data_param) { :project_milestone_ids }
|
165
|
+
let(:param_names) { %w(id) }
|
166
|
+
end
|
167
|
+
end
|
168
|
+
|
169
|
+
describe '#add_task_comment' do
|
170
|
+
it_should_behave_like 'an api request' do
|
171
|
+
let(:command) { :add_task_comment }
|
172
|
+
let(:args) { [random_id(:project_task), random_word] }
|
173
|
+
let(:add_data_to_collector) { true }
|
174
|
+
let(:data_param) { :comment_ids }
|
175
|
+
let(:param_names) { %w(id) }
|
176
|
+
end
|
177
|
+
end
|
178
|
+
|
179
|
+
describe '#add_message_comment' do
|
180
|
+
it_should_behave_like 'an api request' do
|
181
|
+
let(:command) { :add_message_comment }
|
182
|
+
let(:args) { [random_id(:project_task), random_word] }
|
183
|
+
let(:add_data_to_collector) { true }
|
184
|
+
let(:data_param) { :comment_ids }
|
185
|
+
let(:param_names) { %w(id) }
|
186
|
+
end
|
187
|
+
end
|
188
|
+
|
189
|
+
describe '#get_latest_discussion_messages' do
|
190
|
+
it_should_behave_like 'an api request' do
|
191
|
+
let(:command) { :get_latest_discussion_messages }
|
192
|
+
end
|
193
|
+
end
|
194
|
+
|
195
|
+
describe '#get_message_by_filter' do
|
196
|
+
it_should_behave_like 'an api request' do
|
197
|
+
let(:command) { :get_message_by_filter }
|
198
|
+
let(:args) { [{projectId: random_id(:new_project)}] }
|
199
|
+
end
|
200
|
+
end
|
201
|
+
|
202
|
+
describe '#get_messages' do
|
203
|
+
it_should_behave_like 'an api request' do
|
204
|
+
let(:command) { :get_messages }
|
205
|
+
let(:args) { [random_id(:new_project)] }
|
206
|
+
end
|
207
|
+
end
|
208
|
+
|
209
|
+
describe '#check_subscription_to_discussion' do
|
210
|
+
it_should_behave_like 'an api request' do
|
211
|
+
let(:command) { :check_subscription_to_discussion }
|
212
|
+
let(:args) { [random_id(:discussion)] }
|
213
|
+
end
|
214
|
+
end
|
215
|
+
|
216
|
+
describe '#update_message' do
|
217
|
+
it_should_behave_like 'an api request' do
|
218
|
+
let(:command) { :update_message }
|
219
|
+
let(:args) { [random_id(:discussion), random_id(:new_project), random_word, random_word] }
|
220
|
+
end
|
221
|
+
end
|
222
|
+
|
223
|
+
describe '#subscribe_to_message_action' do
|
224
|
+
it_should_behave_like 'an api request' do
|
225
|
+
let(:command) { :subscribe_to_message_action }
|
226
|
+
let(:args) { [random_id(:discussion)] }
|
227
|
+
end
|
228
|
+
end
|
229
|
+
|
230
|
+
describe '#get_task_files' do
|
231
|
+
it_should_behave_like 'an api request' do
|
232
|
+
let(:command) { :get_task_files }
|
233
|
+
let(:args) { [random_id(:project_task)] }
|
234
|
+
end
|
235
|
+
end
|
236
|
+
|
237
|
+
describe '#get_entity_files' do
|
238
|
+
it_should_behave_like 'an api request' do
|
239
|
+
let(:command) { :get_entity_files }
|
240
|
+
let(:args) { [random_id(:project_task), 'Task'] }
|
241
|
+
end
|
242
|
+
end
|
243
|
+
|
244
|
+
describe '#get_message_files' do
|
245
|
+
it_should_behave_like 'an api request' do
|
246
|
+
let(:command) { :get_message_files }
|
247
|
+
let(:args) { [random_id(:discussion)] }
|
248
|
+
end
|
249
|
+
end
|
250
|
+
|
251
|
+
describe '#get_comment' do
|
252
|
+
it_should_behave_like 'an api request' do
|
253
|
+
let(:command) { :get_comment }
|
254
|
+
let(:args) { [random_id(:comment)] }
|
255
|
+
end
|
256
|
+
end
|
257
|
+
|
258
|
+
describe '#get_task_comments' do
|
259
|
+
it_should_behave_like 'an api request' do
|
260
|
+
let(:command) { :get_task_comments }
|
261
|
+
let(:args) { [random_id(:project_task)] }
|
262
|
+
end
|
263
|
+
end
|
264
|
+
|
265
|
+
describe '#get_message_comments' do
|
266
|
+
it_should_behave_like 'an api request' do
|
267
|
+
let(:command) { :get_message_comments }
|
268
|
+
let(:args) { [random_id(:discussion)] }
|
269
|
+
end
|
270
|
+
end
|
271
|
+
|
272
|
+
describe '#update_comment' do
|
273
|
+
it_should_behave_like 'an api request' do
|
274
|
+
let(:command) { :update_comment }
|
275
|
+
let(:args) { [random_id(:comment), random_word] }
|
276
|
+
end
|
277
|
+
end
|
278
|
+
|
279
|
+
describe '#create_report_template' do
|
280
|
+
it_should_behave_like 'an api request' do
|
281
|
+
let(:command) { :create_report_template }
|
282
|
+
let(:args) { [random_word] }
|
283
|
+
let(:add_data_to_collector) { true }
|
284
|
+
let(:data_param) { :report_template_ids }
|
285
|
+
let(:param_names) { %w(id) }
|
286
|
+
end
|
287
|
+
end
|
288
|
+
|
289
|
+
describe '#update_report_template' do
|
290
|
+
it_should_behave_like 'an api request' do
|
291
|
+
let(:command) { :update_report_template }
|
292
|
+
let(:args) { [random_id(:report_template), random_word] }
|
293
|
+
end
|
294
|
+
end
|
295
|
+
|
296
|
+
describe '#delete_report_template' do
|
297
|
+
it_should_behave_like 'an api request' do
|
298
|
+
let(:command) { :delete_report_template }
|
299
|
+
let(:args) { [DATA_COLLECTOR[:report_template_ids].pop] }
|
300
|
+
end
|
301
|
+
end
|
302
|
+
|
303
|
+
describe '#get_projects' do
|
304
|
+
it_should_behave_like 'an api request' do
|
305
|
+
let(:command) { :get_projects }
|
306
|
+
end
|
307
|
+
end
|
308
|
+
|
309
|
+
describe '#get_project' do
|
310
|
+
it_should_behave_like 'an api request' do
|
311
|
+
let(:command) { :get_project }
|
312
|
+
let(:args) { [random_id(:new_project)] }
|
313
|
+
end
|
314
|
+
end
|
315
|
+
|
316
|
+
describe '#get_participated_projects' do
|
317
|
+
it_should_behave_like 'an api request' do
|
318
|
+
let(:command) { :get_participated_projects }
|
319
|
+
end
|
320
|
+
end
|
321
|
+
|
322
|
+
describe '#filter_projects' do
|
323
|
+
it_should_behave_like 'an api request' do
|
324
|
+
let(:command) { :filter_projects }
|
325
|
+
end
|
326
|
+
end
|
327
|
+
|
328
|
+
describe '#get_followed_projects' do
|
329
|
+
it_should_behave_like 'an api request' do
|
330
|
+
let(:command) { :get_followed_projects }
|
331
|
+
end
|
332
|
+
end
|
333
|
+
|
334
|
+
describe '#get_project_by_status' do
|
335
|
+
it_should_behave_like 'an api request' do
|
336
|
+
let(:command) { :get_project_by_status }
|
337
|
+
let(:args) { [PROJECT_STATUSES.sample] }
|
338
|
+
end
|
339
|
+
end
|
340
|
+
|
341
|
+
describe '#get_templates' do
|
342
|
+
it_should_behave_like 'an api request' do
|
343
|
+
let(:command) { :get_templates }
|
344
|
+
end
|
345
|
+
end
|
346
|
+
|
347
|
+
describe '#get_spent_time' do
|
348
|
+
it_should_behave_like 'an api request' do
|
349
|
+
let(:command) { :get_spent_time }
|
350
|
+
let(:args) { [random_id(:new_project)] }
|
351
|
+
end
|
352
|
+
end
|
353
|
+
|
354
|
+
describe '#get_project_files' do
|
355
|
+
it_should_behave_like 'an api request' do
|
356
|
+
let(:command) { :get_project_files }
|
357
|
+
let(:args) { [random_id(:new_project)] }
|
358
|
+
end
|
359
|
+
end
|
360
|
+
|
361
|
+
describe '#get_template' do
|
362
|
+
it_should_behave_like 'an api request' do
|
363
|
+
pending 'http://bugzserver/show_bug.cgi?id=23875'
|
364
|
+
let(:command) { :get_template }
|
365
|
+
let(:args) { [random_id(:project_template)] }
|
366
|
+
end
|
367
|
+
end
|
368
|
+
|
369
|
+
describe '#get_milestones' do
|
370
|
+
it_should_behave_like 'an api request' do
|
371
|
+
let(:command) { :get_milestones }
|
372
|
+
let(:args) { [random_id(:new_project)] }
|
373
|
+
end
|
374
|
+
end
|
375
|
+
|
376
|
+
describe '#search_all_projects' do
|
377
|
+
it_should_behave_like 'an api request' do
|
378
|
+
let(:command) { :search_all_projects }
|
379
|
+
let(:args) { [random_word] }
|
380
|
+
end
|
381
|
+
end
|
382
|
+
|
383
|
+
describe '#search_project' do
|
384
|
+
it_should_behave_like 'an api request' do
|
385
|
+
let(:command) { :search_project }
|
386
|
+
let(:args) { [random_id(:new_project), random_word] }
|
387
|
+
end
|
388
|
+
end
|
389
|
+
|
390
|
+
describe '#get_milestones_with_status' do
|
391
|
+
it_should_behave_like 'an api request' do
|
392
|
+
let(:command) { :get_milestones_with_status }
|
393
|
+
let(:args) { [random_id(:new_project), PROJECT_MILESTONE_STATUSES.sample] }
|
394
|
+
end
|
395
|
+
end
|
396
|
+
|
397
|
+
describe '#update_project_tags' do
|
398
|
+
it_should_behave_like 'an api request' do
|
399
|
+
let(:command) { :update_project_tags }
|
400
|
+
let(:args) { [random_id(:new_project), random_word(3)] }
|
401
|
+
end
|
402
|
+
end
|
403
|
+
|
404
|
+
describe '#update_project_status' do
|
405
|
+
it_should_behave_like 'an api request' do
|
406
|
+
let(:command) { :update_project_status }
|
407
|
+
let(:args) { [random_id(:new_project), PROJECT_STATUSES.sample] }
|
408
|
+
end
|
409
|
+
end
|
410
|
+
|
411
|
+
describe '#update_template' do
|
412
|
+
it_should_behave_like 'an api request' do
|
413
|
+
let(:command) { :update_template }
|
414
|
+
let(:args) { [random_id(:project_template), random_word] }
|
415
|
+
end
|
416
|
+
end
|
417
|
+
|
418
|
+
describe '#follow_unfollow_project' do
|
419
|
+
it_should_behave_like 'an api request' do
|
420
|
+
let(:command) { :follow_unfollow_project }
|
421
|
+
let(:args) { [random_id(:new_project)] }
|
422
|
+
end
|
423
|
+
end
|
424
|
+
|
425
|
+
describe '#get_tasks_by_ids' do
|
426
|
+
it_should_behave_like 'an api request' do
|
427
|
+
let(:command) { :get_tasks_by_ids }
|
428
|
+
let(:args) { [DATA_COLLECTOR[:project_task_ids].sample(rand(2..4))] }
|
429
|
+
end
|
430
|
+
end
|
431
|
+
|
432
|
+
describe '#get_task_order' do
|
433
|
+
it_should_behave_like 'an api request' do
|
434
|
+
let(:command) { :get_task_order }
|
435
|
+
let(:args) { [random_id(:new_project)] }
|
436
|
+
end
|
437
|
+
end
|
438
|
+
|
439
|
+
describe '#get_simple_task_by_filter' do
|
440
|
+
it_should_behave_like 'an api request' do
|
441
|
+
let(:command) { :get_simple_task_by_filter }
|
442
|
+
let(:args) { [random_id(:new_project)] }
|
443
|
+
end
|
444
|
+
end
|
445
|
+
|
446
|
+
describe '#add_link' do
|
447
|
+
it_should_behave_like 'an api request' do
|
448
|
+
pending 'http://bugzserver/show_bug.cgi?id=23861'
|
449
|
+
let(:command) { :add_link }
|
450
|
+
let(:args) { [random_id(:project_task), random_id(:project_task), PROJECT_TASK_LINK_TYPES.sample] }
|
451
|
+
end
|
452
|
+
end
|
453
|
+
|
454
|
+
describe '#update_project' do
|
455
|
+
it_should_behave_like 'an api request' do
|
456
|
+
let(:command) { :update_project }
|
457
|
+
let(:args) { [random_id(:new_project), random_word, random_id(:user), {private: random_bool, notify: random_bool}] }
|
458
|
+
end
|
459
|
+
end
|
460
|
+
|
461
|
+
describe '#set_task_order' do
|
462
|
+
it_should_behave_like 'an api request' do
|
463
|
+
let(:command) { :set_task_order }
|
464
|
+
let(:args) { [random_id(:new_project), '123456'] }
|
465
|
+
end
|
466
|
+
end
|
467
|
+
|
468
|
+
describe '#update_project_task' do
|
469
|
+
it_should_behave_like 'an api request' do
|
470
|
+
let(:command) { :update_project_task }
|
471
|
+
let(:args) { [random_id(:project_task), random_word] }
|
472
|
+
end
|
473
|
+
end
|
474
|
+
|
475
|
+
describe '#get_project_team' do
|
476
|
+
it_should_behave_like 'an api request' do
|
477
|
+
let(:command) { :get_project_team }
|
478
|
+
let(:args) { [random_id(:new_project)] }
|
479
|
+
end
|
480
|
+
end
|
481
|
+
|
482
|
+
describe '#get_projects_teams' do
|
483
|
+
it_should_behave_like 'an api request' do
|
484
|
+
let(:command) { :get_projects_teams }
|
485
|
+
let(:args) { [DATA_COLLECTOR[:new_project_ids].sample(rand(2..4))] }
|
486
|
+
end
|
487
|
+
end
|
488
|
+
|
489
|
+
describe '#add_to_team' do
|
490
|
+
it_should_behave_like 'an api request' do
|
491
|
+
let(:command) { :add_to_team }
|
492
|
+
let(:args) { [random_id(:new_project), random_id(:user)] }
|
493
|
+
end
|
494
|
+
end
|
495
|
+
|
496
|
+
describe '#update_project_team' do
|
497
|
+
it_should_behave_like 'an api request' do
|
498
|
+
let(:command) { :update_project_team }
|
499
|
+
let(:args) { [random_id(:new_project), DATA_COLLECTOR[:user_ids].sample(rand(2..4)), {notify: random_bool}] }
|
500
|
+
end
|
501
|
+
end
|
502
|
+
|
503
|
+
describe '#set_team_security' do
|
504
|
+
it_should_behave_like 'an api request' do
|
505
|
+
let(:command) { :set_team_security }
|
506
|
+
let(:args) { [random_id(:new_project), random_id(:user), PROJECT_SECURITY_RIGHTS.sample] }
|
507
|
+
end
|
508
|
+
end
|
509
|
+
|
510
|
+
describe '#remove_from_team' do
|
511
|
+
it_should_behave_like 'an api request' do
|
512
|
+
let(:command) { :remove_from_team }
|
513
|
+
let(:args) { [random_id(:new_project), random_id(:user)] }
|
514
|
+
end
|
515
|
+
end
|
516
|
+
|
517
|
+
describe '#get_my_tasks' do
|
518
|
+
it_should_behave_like 'an api request' do
|
519
|
+
let(:command) { :get_my_tasks }
|
520
|
+
end
|
521
|
+
end
|
522
|
+
|
523
|
+
describe '#get_task_by_filter' do
|
524
|
+
it_should_behave_like 'an api request' do
|
525
|
+
let(:command) { :get_task_by_filter }
|
526
|
+
let(:args) { [{participant: random_id(:user)}] }
|
527
|
+
end
|
528
|
+
end
|
529
|
+
|
530
|
+
describe '#get_task' do
|
531
|
+
it_should_behave_like 'an api request' do
|
532
|
+
let(:command) { :get_task }
|
533
|
+
let(:args) { [random_id(:project_task)] }
|
534
|
+
end
|
535
|
+
end
|
536
|
+
|
537
|
+
describe '#get_tasks' do
|
538
|
+
it_should_behave_like 'an api request' do
|
539
|
+
let(:command) { :get_tasks }
|
540
|
+
let(:args) { [random_id(:new_project)] }
|
541
|
+
end
|
542
|
+
end
|
543
|
+
|
544
|
+
describe '#get_my_tasks_by_status' do
|
545
|
+
it_should_behave_like 'an api request' do
|
546
|
+
let(:command) { :get_my_tasks_by_status }
|
547
|
+
let(:args) { [PROJECT_TASKS_STATUSES.sample] }
|
548
|
+
end
|
549
|
+
end
|
550
|
+
|
551
|
+
describe '#notify_task_responsible' do
|
552
|
+
it_should_behave_like 'an api request' do
|
553
|
+
let(:command) { :notify_task_responsible }
|
554
|
+
let(:args) { [random_id(:project_task)] }
|
555
|
+
end
|
556
|
+
end
|
557
|
+
|
558
|
+
describe '#get_all_tasks' do
|
559
|
+
it_should_behave_like 'an api request' do
|
560
|
+
let(:command) { :get_all_tasks }
|
561
|
+
let(:args) { [random_id(:new_project)] }
|
562
|
+
end
|
563
|
+
end
|
564
|
+
|
565
|
+
describe '#get_tasks_with_status' do
|
566
|
+
it_should_behave_like 'an api request' do
|
567
|
+
let(:command) { :get_tasks_with_status }
|
568
|
+
let(:args) { [random_id(:new_project), PROJECT_TASKS_STATUSES.sample] }
|
569
|
+
end
|
570
|
+
end
|
571
|
+
|
572
|
+
describe '#update_task_status' do
|
573
|
+
it_should_behave_like 'an api request' do
|
574
|
+
pending 'http://bugzserver/show_bug.cgi?id=23860'
|
575
|
+
let(:command) { :update_task_status }
|
576
|
+
let(:args) { [random_id(:project_task), PROJECT_TASKS_STATUSES.sample] }
|
577
|
+
end
|
578
|
+
end
|
579
|
+
|
580
|
+
describe '#update_subtask' do
|
581
|
+
it_should_behave_like 'an api request' do
|
582
|
+
pending 'http://bugzserver/show_bug.cgi?id=23860'
|
583
|
+
let(:command) { :update_subtask }
|
584
|
+
let(:args) { [DATA_COLLECTOR[:project_task_ids].last, random_id(:project_subtask), random_id(:user), random_word] }
|
585
|
+
end
|
586
|
+
end
|
587
|
+
|
588
|
+
describe '#update_subtask_status' do
|
589
|
+
it_should_behave_like 'an api request' do
|
590
|
+
let(:command) { :update_subtask_status }
|
591
|
+
let(:args) { [DATA_COLLECTOR[:project_task_ids].last, random_id(:project_subtask), PROJECT_TASKS_STATUSES.sample] }
|
592
|
+
end
|
593
|
+
end
|
594
|
+
|
595
|
+
describe '#add_project_contact' do
|
596
|
+
it_should_behave_like 'an api request' do
|
597
|
+
let(:command) { :add_project_contact }
|
598
|
+
let(:args) { [random_id(:new_project), random_id(:contact)] }
|
599
|
+
end
|
600
|
+
end
|
601
|
+
|
602
|
+
describe '#get_projects_for_contact' do
|
603
|
+
it_should_behave_like 'an api request' do
|
604
|
+
let(:command) { :get_projects_for_contact }
|
605
|
+
let(:args) { [random_id(:contact)] }
|
606
|
+
end
|
607
|
+
end
|
608
|
+
|
609
|
+
describe '#get_project_tags' do
|
610
|
+
it_should_behave_like 'an api request' do
|
611
|
+
let(:command) { :get_project_tags }
|
612
|
+
end
|
613
|
+
end
|
614
|
+
|
615
|
+
describe '#get_project_by_tag' do
|
616
|
+
it_should_behave_like 'an api request' do
|
617
|
+
let(:command) { :get_project_by_tag }
|
618
|
+
let(:args) { [random_word(4)] }
|
619
|
+
end
|
620
|
+
end
|
621
|
+
|
622
|
+
describe '#get_tags_by_name' do
|
623
|
+
it_should_behave_like 'an api request' do
|
624
|
+
let(:command) { :get_tags_by_name }
|
625
|
+
let(:args) { [random_word(4)] }
|
626
|
+
end
|
627
|
+
end
|
628
|
+
|
629
|
+
describe '#get_upcoming_milestones' do
|
630
|
+
it_should_behave_like 'an api request' do
|
631
|
+
let(:command) { :get_upcoming_milestones }
|
632
|
+
end
|
633
|
+
end
|
634
|
+
|
635
|
+
describe '#get_overdue_milestones' do
|
636
|
+
it_should_behave_like 'an api request' do
|
637
|
+
let(:command) { :get_overdue_milestones }
|
638
|
+
end
|
639
|
+
end
|
640
|
+
|
641
|
+
describe '#get_milestone' do
|
642
|
+
it_should_behave_like 'an api request' do
|
643
|
+
let(:command) { :get_milestone }
|
644
|
+
let(:args) { [random_id(:project_milestone)] }
|
645
|
+
end
|
646
|
+
end
|
647
|
+
|
648
|
+
describe '#get_milestones_by_filter' do
|
649
|
+
it_should_behave_like 'an api request' do
|
650
|
+
let(:command) { :get_milestones_by_filter }
|
651
|
+
let(:args) { [{projectid: random_id(:new_project)}] }
|
652
|
+
end
|
653
|
+
end
|
654
|
+
|
655
|
+
describe '#get_milestone_tasks' do
|
656
|
+
it_should_behave_like 'an api request' do
|
657
|
+
let(:command) { :get_milestone_tasks }
|
658
|
+
let(:args) { [random_id(:project_milestone)] }
|
659
|
+
end
|
660
|
+
end
|
661
|
+
|
662
|
+
describe '#get_milestones_by_month' do
|
663
|
+
it_should_behave_like 'an api request' do
|
664
|
+
let(:command) { :get_milestones_by_month }
|
665
|
+
let(:args) { [rand(2000..Time.now.year.to_i), rand(1..12)] }
|
666
|
+
end
|
667
|
+
end
|
668
|
+
|
669
|
+
describe '#get_milestones_by_full_date' do
|
670
|
+
it_should_behave_like 'an api request' do
|
671
|
+
let(:command) { :get_milestones_by_full_date }
|
672
|
+
let(:args) { [rand(2000..Time.now.year.to_i), rand(1..12), rand(1..31)] }
|
673
|
+
end
|
674
|
+
end
|
675
|
+
|
676
|
+
describe '#update_milestone' do
|
677
|
+
it_should_behave_like 'an api request' do
|
678
|
+
let(:command) { :update_milestone }
|
679
|
+
let(:args) { [random_id(:project_milestone), random_word, DateTime.commercial(2015).to_s] }
|
680
|
+
end
|
681
|
+
end
|
682
|
+
|
683
|
+
describe '#update_milestone_status' do
|
684
|
+
it_should_behave_like 'an api request' do
|
685
|
+
let(:command) { :update_milestone_status }
|
686
|
+
let(:args) { [random_id(:project_milestone), PROJECT_MILESTONE_STATUSES.sample] }
|
687
|
+
end
|
688
|
+
end
|
689
|
+
|
690
|
+
describe '#get_time_spent_by_filter' do
|
691
|
+
it_should_behave_like 'an api request' do
|
692
|
+
let(:command) { :get_time_spent_by_filter }
|
693
|
+
end
|
694
|
+
end
|
695
|
+
|
696
|
+
describe '#get_total_time_spent_by_filter' do
|
697
|
+
it_should_behave_like 'an api request' do
|
698
|
+
let(:command) { :get_total_time_spent_by_filter }
|
699
|
+
end
|
700
|
+
end
|
701
|
+
|
702
|
+
describe '#get_time_spent' do
|
703
|
+
it_should_behave_like 'an api request' do
|
704
|
+
let(:command) { :get_time_spent }
|
705
|
+
let(:args) { [random_id(:project_task)] }
|
706
|
+
end
|
707
|
+
end
|
708
|
+
|
709
|
+
describe '#update_task_time' do
|
710
|
+
it_should_behave_like 'an api request' do
|
711
|
+
let(:command) { :update_task_time }
|
712
|
+
let(:args) { [random_id(:project_task_time), Time.now.strftime('%Y-%m-%-d'), random_id(:user)] }
|
713
|
+
end
|
714
|
+
end
|
715
|
+
|
716
|
+
describe '#update_time_status_of_payment' do
|
717
|
+
it_should_behave_like 'an api request' do
|
718
|
+
let(:command) { :update_time_status_of_payment }
|
719
|
+
let(:args) { [DATA_COLLECTOR[:project_task_time_ids].sample(rand(2..4)), PROJECT_TASK_TIME_STATUSES.sample] }
|
720
|
+
end
|
721
|
+
end
|
722
|
+
|
723
|
+
describe '#delete_time_spents' do
|
724
|
+
it_should_behave_like 'an api request' do
|
725
|
+
let(:command) { :delete_time_spents }
|
726
|
+
let(:args) { [DATA_COLLECTOR[:project_task_time_ids].pop] }
|
727
|
+
end
|
728
|
+
end
|
729
|
+
|
730
|
+
describe '#delete_project_contact' do
|
731
|
+
it_should_behave_like 'an api request' do
|
732
|
+
let(:command) { :delete_project_contact }
|
733
|
+
let(:args) { [random_id(:new_project), random_id(:contact)] }
|
734
|
+
end
|
735
|
+
end
|
736
|
+
|
737
|
+
describe '#delete_subtask' do
|
738
|
+
it_should_behave_like 'an api request' do
|
739
|
+
let(:command) { :delete_subtask }
|
740
|
+
let(:args) { [DATA_COLLECTOR[:project_task_ids].last, DATA_COLLECTOR[:project_subtask_ids].pop] }
|
741
|
+
end
|
742
|
+
end
|
743
|
+
|
744
|
+
describe '#detach_file_from_task' do
|
745
|
+
it_should_behave_like 'an api request' do
|
746
|
+
let(:command) { :detach_file_from_task }
|
747
|
+
let(:args) { [random_id(:project_task), random_id(:file)] }
|
748
|
+
end
|
749
|
+
end
|
750
|
+
|
751
|
+
describe '#detach_file_from_message' do
|
752
|
+
it_should_behave_like 'an api request' do
|
753
|
+
let(:command) { :detach_file_from_task }
|
754
|
+
let(:args) { [random_id(:discussion), random_id(:file)] }
|
755
|
+
end
|
756
|
+
end
|
757
|
+
|
758
|
+
describe '#delete_message_comments' do
|
759
|
+
it_should_behave_like 'an api request' do
|
760
|
+
let(:command) { :delete_comment }
|
761
|
+
let(:args) { [DATA_COLLECTOR[:comment_ids].pop] }
|
762
|
+
end
|
763
|
+
end
|
764
|
+
|
765
|
+
describe '#delete_milestone' do
|
766
|
+
it_should_behave_like 'an api request' do
|
767
|
+
let(:command) { :delete_milestone }
|
768
|
+
let(:args) { [DATA_COLLECTOR[:project_milestone_ids].pop] }
|
769
|
+
end
|
770
|
+
end
|
771
|
+
|
772
|
+
describe '#delete_task_comments' do
|
773
|
+
it_should_behave_like 'an api request' do
|
774
|
+
let(:command) { :delete_comment }
|
775
|
+
let(:args) { [DATA_COLLECTOR[:comment_ids].pop] }
|
776
|
+
end
|
777
|
+
end
|
778
|
+
|
779
|
+
describe '#delete_task' do
|
780
|
+
it_should_behave_like 'an api request' do
|
781
|
+
let(:command) { :delete_task }
|
782
|
+
let(:args) { [DATA_COLLECTOR[:project_task_ids].pop] }
|
783
|
+
end
|
784
|
+
end
|
785
|
+
|
786
|
+
describe '#delete_project' do
|
787
|
+
it_should_behave_like 'an api request' do
|
788
|
+
let(:command) { :delete_project }
|
789
|
+
let(:args) { [DATA_COLLECTOR[:new_project_ids].pop] }
|
790
|
+
end
|
791
|
+
end
|
792
|
+
|
793
|
+
describe '#delete_template' do
|
794
|
+
it_should_behave_like 'an api request' do
|
795
|
+
let(:command) { :delete_template }
|
796
|
+
let(:args) { [DATA_COLLECTOR[:project_template_ids].pop] }
|
797
|
+
end
|
798
|
+
end
|
799
|
+
|
800
|
+
end
|