teamlab 0.3.10 → 0.3.11

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,11 @@
1
+ BEGIN:VCALENDAR
2
+ PRODID:TeamLab Calendar
3
+ VERSION:2.0
4
+ METHOD:PUBLISH
5
+ CALSCALE:GREGORIAN
6
+ X-WR-CALNAME:test
7
+ X-WR-TIMEZONE:Europe/Moscow
8
+ BEGIN:VTIMEZONE
9
+ TZID:Europe/Moscow
10
+ END:VTIMEZONE
11
+ END:VCALENDAR
Binary file
@@ -0,0 +1,319 @@
1
+ require_relative '../spec_helper'
2
+
3
+ describe '[Files]' do
4
+ before :all do
5
+ Teamlab.configure do |config|
6
+ config.server = SERVER
7
+ config.username = USERNAME
8
+ config.password = PASSWORD
9
+ end
10
+ end
11
+
12
+ let(:teamlab_module) { :files }
13
+
14
+ describe '#get_my_files' do
15
+ it_should_behave_like 'an api request' do
16
+ let(:teamlab_module) { :files }
17
+ let(:command) { :get_my_files }
18
+ let(:add_data_to_collector) { true }
19
+ let(:data_param) { :my_documents_ids }
20
+ let(:param_names) { %w(current id) }
21
+ end
22
+ end
23
+
24
+ describe '#get_my_files' do
25
+ it_should_behave_like 'an api request' do
26
+ let(:command) { :get_my_files }
27
+ #let(:add_data_to_collector) { true }
28
+ #let(:data_param) {:my_documents_ids}
29
+ #let(:param_names) {%w(current id)}
30
+ end
31
+ end
32
+
33
+ describe '#get_trash' do
34
+ it_should_behave_like 'an api request' do
35
+ let(:command) { :get_trash }
36
+ let(:add_data_to_collector) { true }
37
+ let(:data_param) {:trash_documents_ids}
38
+ let(:param_names) {%w(current id)}
39
+ end
40
+ end
41
+
42
+ describe '#get_shared_docs' do
43
+ it_should_behave_like 'an api request' do
44
+ let(:command) { :get_shared_docs }
45
+ let(:add_data_to_collector) { true }
46
+ let(:data_param) {:shared_documents_ids}
47
+ let(:param_names) {%w(current id)}
48
+ end
49
+ end
50
+
51
+ describe '#get_common_docs' do
52
+ it_should_behave_like 'an api request' do
53
+ let(:command) { :get_common_docs }
54
+ let(:add_data_to_collector) { true }
55
+ let(:data_param) {:common_documents_ids}
56
+ let(:param_names) {%w(current id)}
57
+ end
58
+ end
59
+
60
+ describe '#new_folder' do
61
+ it_should_behave_like 'an api request' do
62
+ let(:command) { :new_folder }
63
+ let(:args) { [random_id(:my_documents), random_word] }
64
+ let(:add_data_to_collector) { true }
65
+ let(:data_param) {:new_folder_ids}
66
+ let(:param_names) {%w(current id)}
67
+ end
68
+ end
69
+
70
+ describe '#get_folder' do
71
+ it_should_behave_like 'an api request' do
72
+ let(:command) { :get_folder }
73
+ let(:args) { [random_id(:new_folder)] }
74
+ end
75
+ end
76
+
77
+ describe '#rename_folder' do
78
+ it_should_behave_like 'an api request' do
79
+ let(:command) { :rename_folder }
80
+ let(:args) { [random_id(:new_folder), random_word] }
81
+ end
82
+ end
83
+
84
+ describe '#search' do
85
+ it_should_behave_like 'an api request' do
86
+ let(:command) { :search }
87
+ let(:args) { [random_word] }
88
+ end
89
+ end
90
+
91
+ describe '#create_file' do
92
+ it_should_behave_like 'an api request' do
93
+ let(:command) { :create_file }
94
+ let(:args) { [random_id(:new_folder), random_word] }
95
+ let(:add_data_to_collector) { true }
96
+ let(:data_param) {:new_file_ids}
97
+ let(:param_names) {%w(id)}
98
+ end
99
+ end
100
+
101
+ describe '#generate_shared_link' do
102
+ it_should_behave_like 'an api request' do
103
+ let(:command) { :generate_shared_link }
104
+ let(:args) { [random_id(:new_file), FILES_SHARE_TYPES.sample] }
105
+ end
106
+ end
107
+
108
+ describe '#upload_to_my_docs' do
109
+ it_should_behave_like 'an api request' do
110
+ let(:command) { :upload_to_my_docs }
111
+ let(:args) { [FILE_FOR_UPLOAD] }
112
+ end
113
+ end
114
+
115
+ describe '#upload_to_common_docs' do
116
+ it_should_behave_like 'an api request' do
117
+ let(:command) { :upload_to_common_docs }
118
+ let(:args) { [FILE_FOR_UPLOAD] }
119
+ end
120
+ end
121
+
122
+ describe '#upload_to_folder' do
123
+ it_should_behave_like 'an api request' do
124
+ let(:command) { :upload_to_folder }
125
+ let(:args) { [random_id(:new_folder), FILE_FOR_UPLOAD] }
126
+ end
127
+ end
128
+
129
+ describe '#chunked_upload' do
130
+ it_should_behave_like 'an api request' do
131
+ let(:command) { :chunked_upload }
132
+ let(:args) { [random_id(:new_folder), File.basename(FILE_FOR_UPLOAD), rand(1..50)] }
133
+ end
134
+ end
135
+
136
+ describe '#create_txt_in_my_docs' do
137
+ it_should_behave_like 'an api request' do
138
+ let(:command) { :create_txt_in_my_docs }
139
+ let(:args) { [random_word, random_word(rand(100))] }
140
+ end
141
+ end
142
+
143
+ describe '#create_html_in_my_docs' do
144
+ it_should_behave_like 'an api request' do
145
+ let(:command) { :create_html_in_my_docs }
146
+ let(:args) { [random_word, random_word(rand(100))] }
147
+ end
148
+ end
149
+
150
+ describe '#create_txt_in_common_docs' do
151
+ it_should_behave_like 'an api request' do
152
+ let(:command) { :create_txt_in_common_docs }
153
+ let(:args) { [random_word, random_word(rand(100))] }
154
+ end
155
+ end
156
+
157
+ describe '#create_html_in_common_docs' do
158
+ it_should_behave_like 'an api request' do
159
+ let(:command) { :create_html_in_common_docs }
160
+ let(:args) { [random_word, random_word(rand(100))] }
161
+ end
162
+ end
163
+
164
+ describe '#create_txt' do
165
+ it_should_behave_like 'an api request' do
166
+ let(:command) { :create_txt }
167
+ let(:args) { [random_id(:new_folder), random_word, random_word(rand(100))] }
168
+ end
169
+ end
170
+
171
+ describe '#create_html' do
172
+ it_should_behave_like 'an api request' do
173
+ let(:command) { :create_html }
174
+ let(:args) { [random_id(:new_folder), random_word, random_word(rand(100))] }
175
+ end
176
+ end
177
+
178
+ describe '#get_file_info' do
179
+ it_should_behave_like 'an api request' do
180
+ let(:command) { :get_file_info }
181
+ let(:args) { [random_id(:new_file)] }
182
+ end
183
+ end
184
+
185
+ describe '#get_file_history' do
186
+ it_should_behave_like 'an api request' do
187
+ let(:command) { :get_file_history }
188
+ let(:args) { [random_id(:new_file)] }
189
+ end
190
+ end
191
+
192
+ describe '#update_file_info' do
193
+ it_should_behave_like 'an api request' do
194
+ let(:command) { :update_file_info }
195
+ let(:args) { [random_id(:new_file), random_word, 1] }
196
+ end
197
+ end
198
+
199
+ describe '#get_file_operations_list' do
200
+ it_should_behave_like 'an api request' do
201
+ let(:command) { :get_file_operations_list }
202
+ end
203
+ end
204
+
205
+ describe '#move_files' do
206
+ it_should_behave_like 'an api request' do
207
+ let(:command) { :move_files }
208
+ let(:args) { [random_id(:new_folder), { fileids: DATA_COLLECTOR[:new_file_ids].sample(rand(1..4)), overwrite: random_bool}] }
209
+ end
210
+ end
211
+
212
+ describe '#copy_to_folder' do
213
+ it_should_behave_like 'an api request' do
214
+ let(:command) { :copy_to_folder }
215
+ let(:args) { [random_id(:new_folder), { fileids: DATA_COLLECTOR[:new_file_ids].sample(rand(1..4)), overwrite: random_bool}] }
216
+ end
217
+ end
218
+
219
+ describe '#delete' do
220
+ it_should_behave_like 'an api request' do
221
+ let(:command) { :delete }
222
+ let(:args) { [ folderIds: [], fileids: [] ] }
223
+ end
224
+ end
225
+
226
+ describe '#finish_all' do
227
+ it_should_behave_like 'an api request' do
228
+ let(:command) { :finish_all }
229
+ end
230
+ end
231
+
232
+ describe '#mark_as_read' do
233
+ it_should_behave_like 'an api request' do
234
+ let(:command) { :mark_as_read }
235
+ end
236
+ end
237
+
238
+ describe '#finish_operations' do
239
+ it_should_behave_like 'an api request' do
240
+ let(:command) { :finish_operations }
241
+ let(:args) { [ folderIds: [random_id(:new_folder)], fileids: [random_id(:new_file)] ] }
242
+ end
243
+ end
244
+
245
+ describe '#get_file_sharing' do
246
+ it_should_behave_like 'an api request' do
247
+ let(:command) { :get_file_sharing }
248
+ let(:args) { [random_id(:new_file)] }
249
+ end
250
+ end
251
+
252
+ describe '#get_folder_sharing' do
253
+ it_should_behave_like 'an api request' do
254
+ let(:command) { :get_folder_sharing }
255
+ let(:args) { [random_id(:new_folder)] }
256
+ end
257
+ end
258
+
259
+ describe '#share_file' do
260
+ it_should_behave_like 'an api request' do
261
+ let(:command) { :share_file }
262
+ let(:args) { [random_id(:new_file), random_id(:user), 1, { notify: random_bool, sharingMessage: random_word }] }
263
+ end
264
+ end
265
+
266
+ describe '#share_folder' do
267
+ it_should_behave_like 'an api request' do
268
+ let(:command) { :share_folder }
269
+ let(:args) { [random_id(:new_folder), random_id(:user), 1, { notify: random_bool, sharingMessage: random_word }] }
270
+ end
271
+ end
272
+
273
+ describe '#remove_file_sharing_rights' do
274
+ it_should_behave_like 'an api request' do
275
+ let(:command) { :remove_file_sharing_rights }
276
+ let(:args) { [ random_id(:new_file), [random_id(:user)] ] }
277
+ end
278
+ end
279
+
280
+ describe '#remove_folder_sharing_rights' do
281
+ it_should_behave_like 'an api request' do
282
+ let(:command) { :remove_folder_sharing_rights }
283
+ let(:args) { [ random_id(:new_folder), [random_id(:user)] ] }
284
+ end
285
+ end
286
+
287
+ describe '#get_third_party' do
288
+ it_should_behave_like 'an api request' do
289
+ let(:command) { :get_third_party }
290
+ end
291
+ end
292
+
293
+ describe '#remove_third_party_account' do
294
+ it_should_behave_like 'an api request' do
295
+ let(:command) { :remove_third_party_account }
296
+ let(:args) { PROVIDER_ID }
297
+ end
298
+ end
299
+
300
+ describe '#delete_file' do
301
+ it_should_behave_like 'an api request' do
302
+ let(:command) { :delete_file }
303
+ let(:args) { [DATA_COLLECTOR[:new_file_ids].pop] }
304
+ end
305
+ end
306
+
307
+ describe '#delete_folder' do
308
+ it_should_behave_like 'an api request' do
309
+ let(:command) { :delete_folder }
310
+ let(:args) { [DATA_COLLECTOR[:new_folder_ids].pop] }
311
+ end
312
+ end
313
+
314
+ describe '#clear_recycle_bin' do
315
+ it_should_behave_like 'an api request' do
316
+ let(:command) { :clear_recycle_bin }
317
+ end
318
+ end
319
+ end
@@ -0,0 +1,96 @@
1
+ require_relative '../spec_helper'
2
+
3
+ describe '[Group]' do
4
+ before :all do
5
+ Teamlab.configure do |config|
6
+ config.server = SERVER
7
+ config.username = USERNAME
8
+ config.password = PASSWORD
9
+ end
10
+ end
11
+
12
+ let(:teamlab_module) { :group }
13
+
14
+ describe '#add_user' do
15
+ it_should_behave_like 'an api request' do
16
+ let(:teamlab_module) { :people }
17
+ let(:command) { :add_user }
18
+ let(:args) { [false, random_email, random_word.capitalize, random_word.capitalize] }
19
+ let(:add_data_to_collector) { true }
20
+ let(:data_param) { :user_ids }
21
+ let(:param_names) { %w(id) }
22
+ end
23
+ end
24
+
25
+ describe '#get_groups' do
26
+ it_should_behave_like 'an api request' do
27
+ let(:command) { :get_groups }
28
+ end
29
+ end
30
+
31
+ describe '#add_group' do
32
+ it_should_behave_like 'an api request' do
33
+ let(:command) { :add_group }
34
+ let(:args) { [random_id(:user), random_word, DATA_COLLECTOR[:user_ids]] }
35
+ let(:add_data_to_collector) { true }
36
+ let(:data_param) {:group_ids}
37
+ let(:param_names) {%w(id)}
38
+ end
39
+ end
40
+
41
+ describe '#get_group' do
42
+ it_should_behave_like 'an api request' do
43
+ let(:command) { :get_group }
44
+ let(:args) { [random_id(:group)] }
45
+ end
46
+ end
47
+
48
+ describe '#replace_members' do
49
+ it_should_behave_like 'an api request' do
50
+ let(:command) { :replace_members }
51
+ let(:args) { [random_id(:group), DATA_COLLECTOR[:user_ids]] }
52
+ end
53
+ end
54
+
55
+ describe '#update_group' do
56
+ it_should_behave_like 'an api request' do
57
+ let(:command) { :update_group }
58
+ let(:args) { [random_id(:group), { groupManager: random_id(:user), groupName: random_word, members: DATA_COLLECTOR[:user_ids] }] }
59
+ end
60
+ end
61
+
62
+ describe '#add_group_users' do
63
+ it_should_behave_like 'an api request' do
64
+ let(:command) { :add_group_users }
65
+ let(:args) { [random_id(:group), DATA_COLLECTOR[:user_ids]] }
66
+ end
67
+ end
68
+
69
+ describe '#set_group_manager' do
70
+ it_should_behave_like 'an api request' do
71
+ let(:command) { :set_group_manager }
72
+ let(:args) { [random_id(:group), random_id(:user)] }
73
+ end
74
+ end
75
+
76
+ describe '#move_group_members' do
77
+ it_should_behave_like 'an api request' do
78
+ let(:command) { :move_group_members }
79
+ let(:args) { [random_id(:group), random_id(:group)] }
80
+ end
81
+ end
82
+
83
+ describe '#remove_group_members' do
84
+ it_should_behave_like 'an api request' do
85
+ let(:command) { :remove_group_members }
86
+ let(:args) { [random_id(:group)] }
87
+ end
88
+ end
89
+
90
+ describe '#delete_group' do
91
+ it_should_behave_like 'an api request' do
92
+ let(:command) { :delete_group }
93
+ let(:args) { [DATA_COLLECTOR[:group_ids].pop] }
94
+ end
95
+ end
96
+ end
@@ -0,0 +1,60 @@
1
+ require_relative '../spec_helper'
2
+
3
+ describe '[Mail]' do
4
+
5
+ let(:teamlab_module) { :mail }
6
+
7
+ before :all do
8
+ Teamlab.configure do |config|
9
+ config.server = SERVER
10
+ config.username = USERNAME
11
+ config.password = PASSWORD
12
+ end
13
+ end
14
+
15
+ describe '#create_tag' do
16
+ it_should_behave_like 'an api request' do
17
+ let(:command) { :create_tag }
18
+ let(:args) { [random_word(4), {style: rand(15)}] }
19
+ end
20
+ end
21
+
22
+ describe '#create_account_by_email' do
23
+ it_should_behave_like 'an api request' do
24
+ let(:command) { :create_account_by_email }
25
+ let(:args) { [USERNAME, PASSWORD] }
26
+ end
27
+ end
28
+
29
+ describe '#get_filtered_messages' do
30
+ it_should_behave_like 'an api request' do
31
+ let(:command) { :get_filtered_messages }
32
+ let(:args) { [2] }
33
+ end
34
+ end
35
+
36
+ describe '#get_message' do
37
+ it_should_behave_like 'an api request' do
38
+ let(:command) { :get_message }
39
+ let(:args) {message_id}
40
+ end
41
+ end
42
+
43
+ describe '#get_message_template' do
44
+ it_should_behave_like 'an api request' do
45
+ let(:command) { :get_message_template }
46
+ end
47
+ end
48
+
49
+ describe '#get_account_list' do
50
+ it_should_behave_like 'an api request' do
51
+ let(:command) { :get_account_list }
52
+ end
53
+ end
54
+
55
+ describe '#get_tag_list' do
56
+ it_should_behave_like 'an api request' do
57
+ let(:command) { :get_tag_list }
58
+ end
59
+ end
60
+ end
@@ -0,0 +1,164 @@
1
+ require_relative '../spec_helper'
2
+
3
+ describe '[People]' do
4
+ before :all do
5
+ Teamlab.configure do |config|
6
+ config.server = SERVER
7
+ config.username = USERNAME
8
+ config.password = PASSWORD
9
+ end
10
+ end
11
+
12
+ let(:teamlab_module) { :people }
13
+
14
+ describe '#get_people' do
15
+ it_should_behave_like 'an api request' do
16
+ let(:command) { :get_people }
17
+ end
18
+ end
19
+
20
+ describe '#get_self' do
21
+ it_should_behave_like 'an api request' do
22
+ let(:command) { :get_self }
23
+ end
24
+ end
25
+
26
+ describe '#search_people' do
27
+ it_should_behave_like 'an api request' do
28
+ let(:command) { :search_people }
29
+ let(:args) { [random_word(4)] }
30
+ end
31
+ end
32
+
33
+ describe '#filter' do
34
+ it_should_behave_like 'an api request' do
35
+ let(:command) { :filter_people }
36
+ let(:args) { [{activationStatus: 1}] }
37
+ end
38
+ end
39
+
40
+ describe '#add_user' do
41
+ it_should_behave_like 'an api request' do
42
+ let(:command) { :add_user }
43
+ let(:args) { [random_bool, random_email, random_word.capitalize, random_word.capitalize] }
44
+ let(:add_data_to_collector) { true }
45
+ let(:data_param) { :new_user_ids }
46
+ let(:param_names) { %w(id) }
47
+ end
48
+ end
49
+
50
+ describe '#get_user_by_username' do
51
+ it_should_behave_like 'an api request' do
52
+ let(:command) { :get_user_by_username }
53
+ let(:args) { [random_id(:new_user)] }
54
+ let(:add_data_to_collector) { true }
55
+ let(:data_param) { :emails }
56
+ let(:param_names) { %w(email) }
57
+ end
58
+ end
59
+
60
+ describe '#get_people_by_status' do
61
+ it_should_behave_like 'an api request' do
62
+ let(:command) { :get_people_by_status }
63
+ let(:args) { [USER_STATUSES.sample] }
64
+ end
65
+ end
66
+
67
+ describe '#get_people_by_search_query' do
68
+ it_should_behave_like 'an api request' do
69
+ let(:command) { :get_people_by_search_query }
70
+ let(:args) { [random_word] }
71
+ end
72
+ end
73
+
74
+ describe '#remind_password' do
75
+ it_should_behave_like 'an api request' do
76
+ let(:command) { :remind_password }
77
+ let(:args) { [DATA_COLLECTOR[:new_user_ids].first, DATA_COLLECTOR[:emails].pop] }
78
+ end
79
+ end
80
+
81
+ describe '#search_with_status' do
82
+ it_should_behave_like 'an api request' do
83
+ let(:command) { :search_with_status }
84
+ let(:args) { [USER_STATUSES.sample.downcase, random_word] }
85
+ end
86
+ end
87
+
88
+ describe '#update_contacts' do
89
+ it_should_behave_like 'an api request' do
90
+ let(:command) { :update_contacts }
91
+ let(:args) { [random_id(:new_user), USER_CONTACTS] }
92
+ end
93
+ end
94
+
95
+ describe '#send_invite' do
96
+ it_should_behave_like 'an api request' do
97
+ let(:command) { :send_invite }
98
+ let(:args) { [DATA_COLLECTOR[:new_user_ids]] }
99
+ end
100
+ end
101
+
102
+ describe '#delete' do
103
+ it_should_behave_like 'an api request' do
104
+ let(:command) { :delete }
105
+ let(:args) { [[]] }
106
+ end
107
+ end
108
+
109
+ describe '#update_user' do
110
+ it_should_behave_like 'an api request' do
111
+ let(:command) { :update_user }
112
+ let(:args) { [random_id(:new_user), random_bool, random_email, random_word, random_word, {comment: random_word}] }
113
+ end
114
+ end
115
+
116
+ describe '#change_people_type' do
117
+ it_should_behave_like 'an api request' do
118
+ let(:command) { :change_people_type }
119
+ let(:args) { [USER_TYPES.sample, DATA_COLLECTOR[:new_user_ids]] }
120
+ end
121
+ end
122
+
123
+ describe '#update_photo' do
124
+ it_should_behave_like 'an api request' do
125
+ let(:command) { :update_photo }
126
+ let(:args) { [random_id(:new_user), PATH_TO_IMAGE] }
127
+ end
128
+ end
129
+
130
+ describe '#add_contacts' do
131
+ it_should_behave_like 'an api request' do
132
+ let(:command) { :add_contacts }
133
+ let(:args) { [USER_CONTACTS, random_id(:new_user)] }
134
+ end
135
+ end
136
+
137
+ describe '#delete_photo' do
138
+ it_should_behave_like 'an api request' do
139
+ let(:command) { :delete_photo }
140
+ let(:args) { [random_id(:new_user)] }
141
+ end
142
+ end
143
+
144
+ describe '#delete_contacts' do
145
+ it_should_behave_like 'an api request' do
146
+ let(:command) { :delete_contacts }
147
+ let(:args) { [random_id(:new_user), USER_CONTACTS] }
148
+ end
149
+ end
150
+
151
+ describe '#change_people_status' do
152
+ it_should_behave_like 'an api request' do
153
+ let(:command) { :change_people_status }
154
+ let(:args) { ['Terminated', DATA_COLLECTOR[:new_user_ids]] }
155
+ end
156
+ end
157
+
158
+ describe '#delete_user' do
159
+ it_should_behave_like 'an api request' do
160
+ let(:command) { :delete_user }
161
+ let(:args) { [DATA_COLLECTOR[:new_user_ids].pop] }
162
+ end
163
+ end
164
+ end