reviewlette 0.0.6 → 0.0.7

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,305 +0,0 @@
1
- module Helpers
2
-
3
- def user_details
4
- {
5
- 'id' => 'abcdef123456789012345678',
6
- 'fullName' => 'Test User',
7
- 'username' => 'me',
8
- 'intials' => 'TU',
9
- 'avatarHash' => 'abcdef1234567890abcdef1234567890',
10
- 'bio' => 'a rather dumb user',
11
- 'url' => 'https://trello.com/me',
12
- 'email' => 'johnsmith@example.com'
13
- }
14
- end
15
-
16
- def user_payload
17
- JSON.generate(user_details)
18
- end
19
-
20
- def self.boards_details
21
- [{
22
- 'id' => 'abcdef123456789123456789',
23
- 'name' => 'Test',
24
- 'desc' => 'This is a test board',
25
- 'closed' => false,
26
- 'idOrganization' => 'abcdef123456789123456789',
27
- 'url' => 'https://trello.com/board/test/abcdef123456789123456789'
28
- }]
29
- end
30
-
31
- def boards_payload
32
- JSON.generate(boards_details)
33
- end
34
-
35
- def checklists_details
36
- [{
37
- 'id' => 'abcdef123456789123456789',
38
- 'name' => 'Test Checklist',
39
- 'desc' => 'A marvelous little checklist',
40
- 'closed' => false,
41
- 'position' => 16384,
42
- 'url' => 'https://trello.com/blah/blah',
43
- 'idBoard' => 'abcdef123456789123456789',
44
- 'idList' => 'abcdef123456789123456789',
45
- 'idMembers' => ['abcdef123456789123456789'],
46
- 'checkItems' => { 'id' => 'ghijk987654321' }
47
- }]
48
- end
49
-
50
- def checklists_payload
51
- JSON.generate(checklists_details)
52
- end
53
-
54
- def lists_details
55
- [{
56
- 'id' => 'abcdef123456789123456789',
57
- 'name' => 'To Do',
58
- 'closed' => false,
59
- 'idBoard' => 'abcdef123456789123456789',
60
- 'cards' => cards_details
61
- }]
62
- end
63
-
64
- def lists_payload
65
- JSON.generate(lists_details)
66
- end
67
-
68
- def self.cards_details
69
- [{
70
- 'id' => 'abcdef123456789123456789',
71
- 'idShort' => '1',
72
- 'name' => 'Do something awesome',
73
- 'desc' => 'Awesome things are awesome.',
74
- 'closed' => false,
75
- 'idList' => 'abcdef123456789123456789',
76
- 'idBoard' => 'abcdef123456789123456789',
77
- 'idAttachmentCover' => 'abcdef123456789123456789',
78
- 'idMembers' => ['abcdef123456789123456789'],
79
- 'url' => 'https://trello.com/card/board/specify-the-type-and-scope-of-the-jit-in-a-lightweight-spec/abcdef123456789123456789/abcdef123456789123456789',
80
- 'shortUrl' => 'https://trello.com/c/abcdef12',
81
- 'pos' => 12,
82
- 'dateLastActivity' => '2012-12-07T18:40:24.314Z'
83
- }]
84
- end
85
-
86
-
87
- def cards_payload
88
- JSON.generate(cards_details)
89
- end
90
-
91
- def attachments_details
92
- [{
93
- 'id' => 'abcdef123456789123456789',
94
- 'name' => 'attachment1.png',
95
- 'url' => 'http://trello-assets.domain.tld/attachment1.png',
96
- 'bytes' => 98765,
97
- 'idMember' => 'abcdef123456789123456781',
98
- 'isUpload' => false,
99
- 'date' => '2013-02-28T17:12:28.497Z',
100
- },
101
- {
102
- 'id' => 'abcdef123456789123456781',
103
- 'name' => 'attachment2.png',
104
- 'url' => 'http://trello-assets.domain.tld/attachment2.png',
105
- 'bytes' => 89123,
106
- 'idMember' => 'abcdef123456789123456782',
107
- 'isUpload' => true,
108
- 'date' => '2013-03-01T14:01:25.212Z',
109
- }]
110
- end
111
-
112
- def attachments_payload
113
- JSON.generate(attachments_details)
114
- end
115
-
116
- def card_payload
117
- JSON.generate(cards_details.first)
118
- end
119
-
120
- def orgs_details
121
- [{
122
- 'id' => 'abcdef123456789123456789',
123
- 'name' => 'test',
124
- 'displayName' => 'Test Organization',
125
- 'desc' => 'This is a test organization',
126
- 'url' => 'https://trello.com/test'
127
- }]
128
- end
129
-
130
- def orgs_payload
131
- JSON.generate(orgs_details)
132
- end
133
-
134
- def actions_details
135
- [{
136
- 'id' => '4ee2482134a81a757a08af47',
137
- 'idMemberCreator' => 'abcdef123456789123456789',
138
- 'data'=> {
139
- 'card' => {
140
- 'id' => '4ee2482134a81a757a08af45',
141
- 'name' => 'Bytecode outputter'
142
- },
143
- 'board' => {
144
- 'id' => '4ec54f2f73820a0dea0d1f0e',
145
- 'name' => 'Caribou VM'
146
- },
147
- 'list' => {
148
- 'id' => '4ee238b034a81a757a05cda0',
149
- 'name' => 'Assembler'
150
- }
151
- },
152
- 'date' => '2012-02-10T11:32:17Z',
153
- 'type' => 'createCard'
154
- }]
155
- end
156
-
157
- def actions_payload
158
- JSON.generate(actions_details)
159
- end
160
-
161
- def notification_details
162
- {
163
- 'id' => '4f30d084d5b0f7ab453bee51',
164
- 'unread' => false,
165
- 'type' => 'commentCard',
166
- 'date' => '2012-02-07T07:19:32.393Z',
167
- 'data' => {
168
- 'board' => {
169
- 'id' => 'abcdef123456789123456789',
170
- 'name' => 'Test'
171
- },
172
- 'card'=>{
173
- 'id' => 'abcdef123456789123456789',
174
- 'name' => 'Do something awesome'
175
- },
176
- 'text' => 'test'
177
- },
178
- 'idMemberCreator' => 'abcdef123456789012345678'
179
- }
180
- end
181
-
182
- def notification_payload
183
- JSON.generate(notification_details)
184
- end
185
-
186
- def organization_details
187
- {
188
- 'id' => '4ee7e59ae582acdec8000291',
189
- 'name' => 'publicorg',
190
- 'desc' => 'This is a test organization',
191
- 'members' => [{
192
- 'id' => '4ee7df3ce582acdec80000b2',
193
- 'username' => 'alicetester',
194
- 'fullName' => 'Alice Tester'
195
- }, {
196
- 'id' => '4ee7df74e582acdec80000b6',
197
- 'username' => 'davidtester',
198
- 'fullName' => 'David Tester'
199
- }, {
200
- 'id' => '4ee7e2e1e582acdec8000112',
201
- 'username' => 'edtester',
202
- 'fullName' => 'Ed Tester'
203
- }]
204
- }
205
- end
206
-
207
- def organization_payload
208
- JSON.generate(organization_details)
209
- end
210
-
211
- def token_details
212
- {
213
- 'id' => '4f2c10c7b3eb95a45b294cd5',
214
- 'idMember' => 'abcdef123456789123456789',
215
- 'dateCreated' => '2012-02-03T16:52:23.661Z',
216
- 'permissions' => [
217
- {
218
- 'idModel' => 'me',
219
- 'modelType' => 'Member',
220
- 'read' => true,
221
- 'write' => true
222
- },
223
- {
224
- 'idModel' => '*',
225
- 'modelType' => 'Board',
226
- 'read' => true,
227
- 'write' => true
228
- },
229
- {
230
- 'idModel' => '*',
231
- 'modelType' => 'Organization',
232
- 'read' => true,
233
- 'write' => true
234
- }
235
- ]
236
- }
237
- end
238
-
239
- def token_payload
240
- JSON.generate(token_details)
241
- end
242
-
243
- def label_details
244
- [
245
- {'color' => 'yellow', 'name' => 'iOS'},
246
- {'color' => 'purple', 'name' => 'Issue or bug'}
247
- ]
248
- end
249
-
250
- def label_payload
251
- JSON.generate(label_details)
252
- end
253
-
254
- def label_name_details
255
- [
256
- {'yellow' => 'bug'},
257
- {'red' => 'urgent'},
258
- {'green' => 'deploy'},
259
- {'blue' => 'on hold'},
260
- {'orange' => 'new feature'},
261
- {'purple' => 'experimental'}
262
- ]
263
- end
264
-
265
- def label_name_payload
266
- JSON.generate(label_name_details)
267
- end
268
-
269
- def webhooks_details
270
- [
271
- {
272
- 'id' => 'webhookid',
273
- 'description' => 'Test webhook',
274
- 'idModel' => '1234',
275
- 'callbackURL' => 'http://example.org/webhook',
276
- 'active' => true
277
- }
278
- ]
279
- end
280
-
281
- def webhooks_payload
282
- JSON.generate(webhooks_details)
283
- end
284
-
285
- def webhook_payload
286
- JSON.generate(webhooks_details.first)
287
- end
288
- end
289
-
290
- def oauth_client
291
- Octokit::Client.new(:access_token => '13131313131313131313131313')
292
- end
293
-
294
-
295
- def stub_boards_call
296
- trello_config = Reviewlette::TRELLO_CONFIG1
297
- stub_request(:get, "https://api.trello.com/1/boards/UuKxYj6M?key=#{trello_config['consumerkey']}&token=#{trello_config['oauthtoken']}")
298
- .to_return(:status => 200, :body => Helpers.boards_details.first.to_json)
299
- end
300
-
301
- def stub_card_call
302
- trello_config = Reviewlette::TRELLO_CONFIG1
303
- stub_request(:get, "https://api.trello.com/cards/8SoYLG6A?key=#{trello_config['consumerkey']}&token=#{trello_config['oauthtoken']}")
304
- .to_return(:status => 200, :body => Helpers.cards_details.first.to_json)
305
- end
data/task DELETED
@@ -1 +0,0 @@
1
- rspec