lws 0.4.2 → 6.1.0.beta1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.rdoc +4 -2
- data/bin/lwsconsole +32 -35
- data/lib/lws/auth.rb +425 -152
- data/lib/lws/corporate_website.rb +186 -68
- data/lib/lws/digital_signage.rb +1796 -0
- data/lib/lws/generic.rb +46 -50
- data/lib/lws/maps.rb +84 -38
- data/lib/lws/presence.rb +93 -73
- data/lib/lws/stubbing.rb +2 -2
- data/lib/lws/ticket.rb +230 -177
- data/lib/lws/version.rb +2 -2
- data/lib/lws.rb +66 -25
- data/lws.gemspec +3 -2
- data/test/api_token_middleware_test.rb +4 -4
- data/test/auth_test.rb +95 -8
- data/test/corporate_website_test.rb +44 -2
- data/test/digital_signage_test.rb +829 -0
- data/test/fixtures/auth.yml +4 -1
- data/test/fixtures/permissions.yml +0 -4
- data/test/generic_test.rb +0 -17
- data/test/json_parser_test.rb +57 -0
- data/test/logger_test.rb +2 -1
- data/test/maps_test.rb +22 -1
- data/test/presence_test.rb +18 -18
- data/test/setup_test.rb +5 -0
- data/test/stubbing_test.rb +4 -2
- data/test/test_helper.rb +3 -2
- data/test/ticket_test.rb +59 -44
- metadata +43 -24
@@ -0,0 +1,829 @@
|
|
1
|
+
#
|
2
|
+
# Copyright © 2016 LeftClick B.V.
|
3
|
+
#
|
4
|
+
# This software is property of LeftClick B.V. and cannot be redistributed
|
5
|
+
# and/or modified without permission. The software or any of its parts
|
6
|
+
# cannot be used for any other purposes than the LeftClick services and
|
7
|
+
# only during a valid license subscription. For more information, please
|
8
|
+
# contact LeftClick B.V. at: Geldropseweg 8B, 5731 SG Mierlo, The
|
9
|
+
# Netherlands, info@leftclick.eu, +31492-782120.
|
10
|
+
|
11
|
+
|
12
|
+
require "test_helper"
|
13
|
+
|
14
|
+
class TestDigitalSignageChannel < MiniTest::Test
|
15
|
+
|
16
|
+
include LWS::DigitalSignage
|
17
|
+
|
18
|
+
def setup
|
19
|
+
@channel = Channel.find(2)
|
20
|
+
end
|
21
|
+
|
22
|
+
def test_valid
|
23
|
+
refute_nil(@channel)
|
24
|
+
assert_instance_of(Channel, @channel)
|
25
|
+
refute_nil(@channel.id)
|
26
|
+
end
|
27
|
+
|
28
|
+
def test_valid_associations
|
29
|
+
assert_instance_of(LWS::Auth::Company, @channel.company)
|
30
|
+
assert_instance_of(Display, @channel.display)
|
31
|
+
assert_instance_of(Channel::Group, @channel.groups.first)
|
32
|
+
assert_instance_of(Player, @channel.players.first)
|
33
|
+
assert_instance_of(Channel::Tag, @channel.tags.first)
|
34
|
+
assert_instance_of(Channel::TimeSchedule, @channel.time_schedule)
|
35
|
+
assert_instance_of(Channel::TimeScheduleOverride, @channel.time_schedule_overrides.first)
|
36
|
+
end
|
37
|
+
|
38
|
+
end
|
39
|
+
|
40
|
+
class TestDigitalSignageChannelGroup < MiniTest::Test
|
41
|
+
|
42
|
+
include LWS::DigitalSignage
|
43
|
+
|
44
|
+
def setup
|
45
|
+
@channel_group = Channel::Group.find(2)
|
46
|
+
end
|
47
|
+
|
48
|
+
def test_valid
|
49
|
+
refute_nil(@channel_group)
|
50
|
+
assert_instance_of(Channel::Group, @channel_group)
|
51
|
+
refute_nil(@channel_group.id)
|
52
|
+
end
|
53
|
+
|
54
|
+
def test_valid_associations
|
55
|
+
assert_instance_of(Channel, @channel_group.channels.first)
|
56
|
+
assert_instance_of(LWS::Auth::Company, @channel_group.company)
|
57
|
+
assert_instance_of(Channel::Group, @channel_group.parent)
|
58
|
+
assert_instance_of(Channel::Group::Tag, @channel_group.tags.first)
|
59
|
+
assert_instance_of(Channel::TimeScheduleOverride, @channel_group.time_schedule_overrides.first)
|
60
|
+
end
|
61
|
+
|
62
|
+
end
|
63
|
+
|
64
|
+
class TestDigitalSignageChannelGroupTag < MiniTest::Test
|
65
|
+
|
66
|
+
include LWS::DigitalSignage
|
67
|
+
|
68
|
+
def setup
|
69
|
+
@channel_group = Channel::Group.all.first
|
70
|
+
# Channel group tags only exist as child objects of a channel group
|
71
|
+
@channel_group_tag = @channel_group.tags.first
|
72
|
+
end
|
73
|
+
|
74
|
+
def test_valid
|
75
|
+
refute_nil(@channel_group_tag)
|
76
|
+
assert_instance_of(Channel::Group::Tag, @channel_group_tag)
|
77
|
+
refute_nil(@channel_group_tag.id)
|
78
|
+
end
|
79
|
+
|
80
|
+
def test_valid_associations
|
81
|
+
assert_instance_of(Channel::Group, @channel_group_tag.group)
|
82
|
+
assert_equal(@channel_group, @channel_group_tag.group)
|
83
|
+
end
|
84
|
+
|
85
|
+
end
|
86
|
+
|
87
|
+
class TestDigitalSignageChannelTag < MiniTest::Test
|
88
|
+
|
89
|
+
include LWS::DigitalSignage
|
90
|
+
|
91
|
+
def setup
|
92
|
+
@channel = Channel.find(2)
|
93
|
+
# Channel tags only exist as child objects of a channel
|
94
|
+
@channel_tag = @channel.tags.first
|
95
|
+
end
|
96
|
+
|
97
|
+
def test_valid
|
98
|
+
refute_nil(@channel_tag)
|
99
|
+
assert_instance_of(Channel::Tag, @channel_tag)
|
100
|
+
refute_nil(@channel_tag.id)
|
101
|
+
end
|
102
|
+
|
103
|
+
def test_valid_associations
|
104
|
+
assert_instance_of(Channel, @channel_tag.channel)
|
105
|
+
assert_equal(@channel, @channel_tag.channel)
|
106
|
+
end
|
107
|
+
|
108
|
+
end
|
109
|
+
|
110
|
+
class TestDigitalSignageChannelTimeSchedule < MiniTest::Test
|
111
|
+
|
112
|
+
include LWS::DigitalSignage
|
113
|
+
|
114
|
+
def setup
|
115
|
+
@channel_time_schedule = Channel::TimeSchedule.all.first
|
116
|
+
end
|
117
|
+
|
118
|
+
def test_valid
|
119
|
+
refute_nil(@channel_time_schedule)
|
120
|
+
assert_instance_of(Channel::TimeSchedule, @channel_time_schedule)
|
121
|
+
refute_nil(@channel_time_schedule.id)
|
122
|
+
end
|
123
|
+
|
124
|
+
def test_valid_associations
|
125
|
+
assert_instance_of(Channel, @channel_time_schedule.channels.first)
|
126
|
+
assert_instance_of(LWS::Auth::Company, @channel_time_schedule.company)
|
127
|
+
end
|
128
|
+
|
129
|
+
end
|
130
|
+
|
131
|
+
class TestDigitalSignageChannelTimeScheduleDay < MiniTest::Test
|
132
|
+
|
133
|
+
include LWS::DigitalSignage
|
134
|
+
|
135
|
+
def setup
|
136
|
+
@channel_time_schedule = Channel::TimeSchedule.all.first
|
137
|
+
# Time schedule days only exist as child objects of a time schedule
|
138
|
+
@channel_time_schedule_day = @channel_time_schedule.days.first
|
139
|
+
end
|
140
|
+
|
141
|
+
def test_valid
|
142
|
+
refute_nil(@channel_time_schedule_day)
|
143
|
+
assert_instance_of(Channel::TimeSchedule::Day, @channel_time_schedule_day)
|
144
|
+
refute_nil(@channel_time_schedule_day.id)
|
145
|
+
end
|
146
|
+
|
147
|
+
def test_valid_associations
|
148
|
+
assert_instance_of(Channel::TimeSchedule,
|
149
|
+
@channel_time_schedule_day.time_schedule)
|
150
|
+
assert_equal(@channel_time_schedule, @channel_time_schedule_day.time_schedule)
|
151
|
+
end
|
152
|
+
|
153
|
+
end
|
154
|
+
|
155
|
+
class TestDigitalSignageChannelTimeScheduleOverride < MiniTest::Test
|
156
|
+
|
157
|
+
include LWS::DigitalSignage
|
158
|
+
|
159
|
+
def setup
|
160
|
+
@channel_time_schedule_override = Channel::TimeScheduleOverride.all.first
|
161
|
+
end
|
162
|
+
|
163
|
+
def test_valid
|
164
|
+
refute_nil(@channel_time_schedule_override)
|
165
|
+
assert_instance_of(Channel::TimeScheduleOverride, @channel_time_schedule_override)
|
166
|
+
refute_nil(@channel_time_schedule_override.id)
|
167
|
+
end
|
168
|
+
|
169
|
+
def test_valid_associations
|
170
|
+
assert_instance_of(Channel::Group, @channel_time_schedule_override.groups.first)
|
171
|
+
assert_instance_of(Channel, @channel_time_schedule_override.channels.first)
|
172
|
+
assert_instance_of(LWS::Auth::Company, @channel_time_schedule_override.company)
|
173
|
+
end
|
174
|
+
|
175
|
+
end
|
176
|
+
|
177
|
+
class TestDigitalSignageDisplay < MiniTest::Test
|
178
|
+
|
179
|
+
include LWS::DigitalSignage
|
180
|
+
|
181
|
+
def setup
|
182
|
+
@display = Display.all.first
|
183
|
+
end
|
184
|
+
|
185
|
+
def test_valid
|
186
|
+
refute_nil(@display)
|
187
|
+
assert_instance_of(Display, @display)
|
188
|
+
refute_nil(@display.id)
|
189
|
+
end
|
190
|
+
|
191
|
+
def test_valid_associations
|
192
|
+
assert_instance_of(Channel, @display.channels.first)
|
193
|
+
assert_instance_of(Display::Input, @display.inputs.first)
|
194
|
+
assert_instance_of(Display::Resolution, @display.resolutions.first)
|
195
|
+
end
|
196
|
+
|
197
|
+
end
|
198
|
+
|
199
|
+
class TestDigitalSignageDisplayInput < MiniTest::Test
|
200
|
+
|
201
|
+
include LWS::DigitalSignage
|
202
|
+
|
203
|
+
def setup
|
204
|
+
@display = Display.all.first
|
205
|
+
# Display inputs only exist as child objects of a display
|
206
|
+
@display_input = @display.inputs.first
|
207
|
+
end
|
208
|
+
|
209
|
+
def test_valid
|
210
|
+
refute_nil(@display_input)
|
211
|
+
assert_instance_of(Display::Input, @display_input)
|
212
|
+
refute_nil(@display_input.id)
|
213
|
+
end
|
214
|
+
|
215
|
+
def test_valid_associations
|
216
|
+
assert_instance_of(Display, @display_input.display)
|
217
|
+
assert_equal(@display, @display_input.display)
|
218
|
+
end
|
219
|
+
|
220
|
+
end
|
221
|
+
|
222
|
+
class TestDigitalSignageDisplayResolution < MiniTest::Test
|
223
|
+
|
224
|
+
include LWS::DigitalSignage
|
225
|
+
|
226
|
+
def setup
|
227
|
+
@display_resolution = Display::Resolution.all.first
|
228
|
+
end
|
229
|
+
|
230
|
+
def test_valid
|
231
|
+
refute_nil(@display_resolution)
|
232
|
+
assert_instance_of(Display::Resolution, @display_resolution)
|
233
|
+
refute_nil(@display_resolution.id)
|
234
|
+
end
|
235
|
+
|
236
|
+
def test_valid_associations
|
237
|
+
assert_instance_of(Display, @display_resolution.displays.first)
|
238
|
+
assert_instance_of(Player::Model, @display_resolution.models.first)
|
239
|
+
end
|
240
|
+
|
241
|
+
end
|
242
|
+
|
243
|
+
class TestDigitalSignagePlayer < MiniTest::Test
|
244
|
+
|
245
|
+
include LWS::DigitalSignage
|
246
|
+
|
247
|
+
def setup
|
248
|
+
@player = Player.find(1)
|
249
|
+
end
|
250
|
+
|
251
|
+
def test_valid
|
252
|
+
refute_nil(@player)
|
253
|
+
assert_instance_of(Player, @player)
|
254
|
+
refute_nil(@player.id)
|
255
|
+
end
|
256
|
+
|
257
|
+
def test_valid_associations
|
258
|
+
assert_instance_of(Channel, @player.channel)
|
259
|
+
assert_instance_of(LWS::Auth::Company, @player.company)
|
260
|
+
assert_instance_of(Player::Component, @player.components.first)
|
261
|
+
assert_instance_of(Player::Configuration, @player.configuration)
|
262
|
+
assert_instance_of(Player::Log, @player.logs.first)
|
263
|
+
assert_instance_of(Player::Model, @player.model)
|
264
|
+
assert_instance_of(Player::Notification, @player.notifications.first)
|
265
|
+
assert_instance_of(Player::Component::Part, @player.parts.first)
|
266
|
+
assert_instance_of(Player::Os::ReleaseChannel, @player.release_channel)
|
267
|
+
assert_instance_of(Player::Request, @player.requests.first)
|
268
|
+
assert_instance_of(Player::Screenshot, @player.screenshots.first)
|
269
|
+
assert_instance_of(Player::Tag, @player.tags.first)
|
270
|
+
end
|
271
|
+
|
272
|
+
end
|
273
|
+
|
274
|
+
class TestDigitalSignagePlayerComponent < MiniTest::Test
|
275
|
+
|
276
|
+
include LWS::DigitalSignage
|
277
|
+
|
278
|
+
def setup
|
279
|
+
@player_component = Player::Component.all.first
|
280
|
+
end
|
281
|
+
|
282
|
+
def test_valid
|
283
|
+
refute_nil(@player_component)
|
284
|
+
assert_instance_of(Player::Component, @player_component)
|
285
|
+
refute_nil(@player_component.id)
|
286
|
+
end
|
287
|
+
|
288
|
+
def test_valid_associations
|
289
|
+
assert_instance_of(Player::Model, @player_component.models.first)
|
290
|
+
assert_instance_of(Player::Component::Part, @player_component.parts.first)
|
291
|
+
@player_component.company_id = @player_component.supplier_id
|
292
|
+
assert_instance_of(LWS::Auth::Company, @player_component.supplier)
|
293
|
+
end
|
294
|
+
|
295
|
+
end
|
296
|
+
|
297
|
+
class TestDigitalSignagePlayerComponentPart < MiniTest::Test
|
298
|
+
|
299
|
+
include LWS::DigitalSignage
|
300
|
+
|
301
|
+
def setup
|
302
|
+
@player_component = Player::Component.all.first
|
303
|
+
# Player component parts only exist as child objects of player components
|
304
|
+
@player_component_part = @player_component.parts.first
|
305
|
+
end
|
306
|
+
|
307
|
+
def test_valid
|
308
|
+
refute_nil(@player_component_part)
|
309
|
+
assert_instance_of(Player::Component::Part, @player_component_part)
|
310
|
+
refute_nil(@player_component_part.id)
|
311
|
+
end
|
312
|
+
|
313
|
+
def test_valid_associations
|
314
|
+
assert_instance_of(Player, @player_component_part.player)
|
315
|
+
assert_instance_of(Player::Component, @player_component_part.component)
|
316
|
+
assert_equal(@player_component, @player_component_part.component)
|
317
|
+
end
|
318
|
+
|
319
|
+
end
|
320
|
+
|
321
|
+
class TestDigitalSignagePlayerConfiguration < MiniTest::Test
|
322
|
+
|
323
|
+
include LWS::DigitalSignage
|
324
|
+
|
325
|
+
def setup
|
326
|
+
@player_configuration = Player::Configuration.all.first
|
327
|
+
end
|
328
|
+
|
329
|
+
def test_valid
|
330
|
+
refute_nil(@player_configuration)
|
331
|
+
assert_instance_of(Player::Configuration, @player_configuration)
|
332
|
+
refute_nil(@player_configuration.id)
|
333
|
+
end
|
334
|
+
|
335
|
+
def test_valid_associations
|
336
|
+
assert_instance_of(LWS::Auth::Company, @player_configuration.company)
|
337
|
+
assert_instance_of(Player, @player_configuration.players.first)
|
338
|
+
assert_instance_of(Player::PredefinedConfiguration,
|
339
|
+
@player_configuration.predefined_configuration)
|
340
|
+
|
341
|
+
assert_instance_of(Player::Configuration::Setting,
|
342
|
+
@player_configuration.settings.first)
|
343
|
+
end
|
344
|
+
|
345
|
+
end
|
346
|
+
|
347
|
+
class TestDigitalSignagePlayerConfigurationSetting < MiniTest::Test
|
348
|
+
|
349
|
+
include LWS::DigitalSignage
|
350
|
+
|
351
|
+
def setup
|
352
|
+
@player_configuration = Player::Configuration.all.first
|
353
|
+
# Player configuration settings only exist as child objects of player
|
354
|
+
# configurations
|
355
|
+
@player_configuration_setting = @player_configuration.settings.first
|
356
|
+
end
|
357
|
+
|
358
|
+
def test_valid
|
359
|
+
refute_nil(@player_configuration_setting)
|
360
|
+
assert_instance_of(Player::Configuration::Setting,
|
361
|
+
@player_configuration_setting)
|
362
|
+
refute_nil(@player_configuration_setting.id)
|
363
|
+
end
|
364
|
+
|
365
|
+
def test_valid_associations
|
366
|
+
assert_instance_of(Player::Configuration,
|
367
|
+
@player_configuration_setting.configuration)
|
368
|
+
end
|
369
|
+
|
370
|
+
end
|
371
|
+
|
372
|
+
class TestDigitalSignagePlayerFeedback < MiniTest::Test
|
373
|
+
|
374
|
+
include LWS::DigitalSignage
|
375
|
+
|
376
|
+
def setup
|
377
|
+
@player = Player.find(1)
|
378
|
+
# Player feedbacks only exist as child objects of players
|
379
|
+
@player_feedback = @player.feedbacks.first
|
380
|
+
end
|
381
|
+
|
382
|
+
def test_valid
|
383
|
+
refute_nil(@player_feedback)
|
384
|
+
assert_instance_of(Player::Feedback, @player_feedback)
|
385
|
+
refute_nil(@player_feedback.id)
|
386
|
+
end
|
387
|
+
|
388
|
+
def test_valid_associations
|
389
|
+
assert_instance_of(Player, @player_feedback.player)
|
390
|
+
assert_equal(@player, @player_feedback.player)
|
391
|
+
# FIXME: Missing branch_id field in LWS
|
392
|
+
#assert_instance_of(Player::Os::Branch::Release, @player_feedback.release)
|
393
|
+
# FIXME: Chained associations don't work yet in Spyke (#89)
|
394
|
+
#assert_instance_of(Player::Feedback::Result, @player_feedback.results.first)
|
395
|
+
end
|
396
|
+
|
397
|
+
end
|
398
|
+
|
399
|
+
class TestDigitalSignagePlayerFeedbackResult < MiniTest::Test
|
400
|
+
|
401
|
+
include LWS::DigitalSignage
|
402
|
+
|
403
|
+
def setup
|
404
|
+
@player = Player.find(1)
|
405
|
+
# Player feedbacks only exist as decendant objects of players
|
406
|
+
@player_feedback = @player.feedbacks.all.first
|
407
|
+
# Player feedback results only exist as decendant objects of player
|
408
|
+
# feedbacks
|
409
|
+
# FIXME: Chained associations don't work yet in Spyke (#89)
|
410
|
+
#@player_feedback_result = @player_feedback.results.first
|
411
|
+
end
|
412
|
+
|
413
|
+
# FIXME: Chained associations don't work yet in Spyke (#89)
|
414
|
+
#def test_valid
|
415
|
+
# refute_nil(@player_feedback_result)
|
416
|
+
# assert_instance_of(Player::Feedback::Result, @player_feedback_result)
|
417
|
+
# refute_nil(@player_feedback_result.id)
|
418
|
+
#end
|
419
|
+
|
420
|
+
# FIXME: Chained associations don't work yet in Spyke (#89)
|
421
|
+
#def test_valid_associations
|
422
|
+
# assert_instance_of(Player, @player_feedback_result.player)
|
423
|
+
# assert_equal(@player_feedback, @player_feedback_result.player)
|
424
|
+
# assert_instance_of(Player::Feedback, @player_feedback_result.feedback)
|
425
|
+
# assert_equal(@player_feedback, @player_feedback_result.feedback)
|
426
|
+
#end
|
427
|
+
|
428
|
+
end
|
429
|
+
|
430
|
+
class TestDigitalSignagePlayerLog < MiniTest::Test
|
431
|
+
|
432
|
+
include LWS::DigitalSignage
|
433
|
+
|
434
|
+
def setup
|
435
|
+
@player = Player.find(1)
|
436
|
+
# Player logs only exist as child object of players
|
437
|
+
@player_log = @player.logs.first
|
438
|
+
end
|
439
|
+
|
440
|
+
def test_valid
|
441
|
+
refute_nil(@player_log)
|
442
|
+
assert_instance_of(Player::Log, @player_log)
|
443
|
+
refute_nil(@player_log.id)
|
444
|
+
end
|
445
|
+
|
446
|
+
def test_valid_associations
|
447
|
+
assert_instance_of(Player, @player_log.player)
|
448
|
+
assert_equal(@player, @player_log.player)
|
449
|
+
end
|
450
|
+
|
451
|
+
end
|
452
|
+
|
453
|
+
class TestDigitalSignagePlayerModel < MiniTest::Test
|
454
|
+
|
455
|
+
include LWS::DigitalSignage
|
456
|
+
|
457
|
+
def setup
|
458
|
+
@player_model = Player::Model.all.first
|
459
|
+
end
|
460
|
+
|
461
|
+
def test_valid
|
462
|
+
refute_nil(@player_model)
|
463
|
+
assert_instance_of(Player::Model, @player_model)
|
464
|
+
refute_nil(@player_model.id)
|
465
|
+
end
|
466
|
+
|
467
|
+
def test_valid_associations
|
468
|
+
assert_instance_of(Player::Os::Branch, @player_model.branches.first)
|
469
|
+
assert_instance_of(Player::Model::Capability,
|
470
|
+
@player_model.capabilities.first)
|
471
|
+
assert_instance_of(Player, @player_model.players.first)
|
472
|
+
assert_instance_of(Player::Os::ReleaseChannel,
|
473
|
+
@player_model.release_channels.first)
|
474
|
+
assert_instance_of(Display::Resolution, @player_model.resolutions.first)
|
475
|
+
end
|
476
|
+
|
477
|
+
end
|
478
|
+
|
479
|
+
class TestDigitalSignagePlayerModelCapability < MiniTest::Test
|
480
|
+
|
481
|
+
include LWS::DigitalSignage
|
482
|
+
|
483
|
+
def setup
|
484
|
+
@player_model = Player::Model.all.first
|
485
|
+
# Player model capabilities only exist as child objects of player models
|
486
|
+
@player_model_capability = @player_model.capabilities.first
|
487
|
+
end
|
488
|
+
|
489
|
+
def test_valid
|
490
|
+
refute_nil(@player_model_capability)
|
491
|
+
assert_instance_of(Player::Model::Capability, @player_model_capability)
|
492
|
+
refute_nil(@player_model_capability.id)
|
493
|
+
end
|
494
|
+
|
495
|
+
def test_valid_associations
|
496
|
+
assert_instance_of(Player::Model, @player_model_capability.model)
|
497
|
+
assert_equal(@player_model, @player_model_capability.model)
|
498
|
+
end
|
499
|
+
|
500
|
+
end
|
501
|
+
|
502
|
+
class TestDigitalSignagePlayerNotification < MiniTest::Test
|
503
|
+
|
504
|
+
include LWS::DigitalSignage
|
505
|
+
|
506
|
+
def setup
|
507
|
+
@player = Player.find(1)
|
508
|
+
# Player notifications only exist as child objects of players
|
509
|
+
@player_notification = @player.notifications.first
|
510
|
+
end
|
511
|
+
|
512
|
+
def test_valid
|
513
|
+
refute_nil(@player_notification)
|
514
|
+
assert_instance_of(Player::Notification, @player_notification)
|
515
|
+
refute_nil(@player_notification.id)
|
516
|
+
end
|
517
|
+
|
518
|
+
def test_valid_associations
|
519
|
+
assert_instance_of(Player, @player_notification.player)
|
520
|
+
assert_equal(@player, @player_notification.player)
|
521
|
+
end
|
522
|
+
|
523
|
+
end
|
524
|
+
|
525
|
+
class TestDigitalSignagePlayerOsBranch < MiniTest::Test
|
526
|
+
|
527
|
+
include LWS::DigitalSignage
|
528
|
+
|
529
|
+
def setup
|
530
|
+
@player_os_branch = Player::Os::Branch.where(slug: "lc5102-development").first
|
531
|
+
end
|
532
|
+
|
533
|
+
def test_valid
|
534
|
+
refute_nil(@player_os_branch)
|
535
|
+
assert_instance_of(Player::Os::Branch, @player_os_branch)
|
536
|
+
refute_nil(@player_os_branch.id)
|
537
|
+
end
|
538
|
+
|
539
|
+
def test_valid_associations
|
540
|
+
assert_instance_of(Player::Os::ReleaseChannel,
|
541
|
+
@player_os_branch.release_channel)
|
542
|
+
assert_instance_of(Player::Os::Branch::Release,
|
543
|
+
@player_os_branch.releases.first)
|
544
|
+
end
|
545
|
+
|
546
|
+
end
|
547
|
+
|
548
|
+
class TestDigitalSignagePlayerOsBranchRelease < MiniTest::Test
|
549
|
+
|
550
|
+
include LWS::DigitalSignage
|
551
|
+
|
552
|
+
def setup
|
553
|
+
@player_os_branch = Player::Os::Branch.where(slug: "lc5102-development").first
|
554
|
+
# Player OS branch releases only exist as child objects of player OS
|
555
|
+
# branches
|
556
|
+
@player_os_branch_release = @player_os_branch.releases.last
|
557
|
+
end
|
558
|
+
|
559
|
+
def test_valid
|
560
|
+
refute_nil(@player_os_branch_release)
|
561
|
+
assert_instance_of(Player::Os::Branch::Release, @player_os_branch_release)
|
562
|
+
refute_nil(@player_os_branch_release.id)
|
563
|
+
end
|
564
|
+
|
565
|
+
def test_valid_associations
|
566
|
+
assert_instance_of(Player::Os::Branch, @player_os_branch_release.branch)
|
567
|
+
assert_equal(@player_os_branch, @player_os_branch_release.branch)
|
568
|
+
# FIXME: Bug in Spyke (#90)
|
569
|
+
#assert_instance_of(Player::Os::Branch::Release, @player_os_branch_release.parent)
|
570
|
+
# FIXME: Not available as data yet
|
571
|
+
#assert_instance_of(Player::Os::Branch::Release, @player_os_branch_release.promoted_release)
|
572
|
+
#assert_instance_of(Player::Os::Branch::Release, @player_os_branch_release.promoting_releases.first)
|
573
|
+
# FIXME: Chained associations don't work yet in Spyke (#89)
|
574
|
+
#assert_instance_of(Player::Os::Package::VersionChange,
|
575
|
+
# @player_os_branch_release.package_version_changes.first)
|
576
|
+
#assert_instance_of(Player::Os::Package::Version,
|
577
|
+
# @player_os_branch_release.package_versions.first)
|
578
|
+
end
|
579
|
+
|
580
|
+
end
|
581
|
+
|
582
|
+
class TestDigitalSignagePlayerOsPackage < MiniTest::Test
|
583
|
+
|
584
|
+
include LWS::DigitalSignage
|
585
|
+
|
586
|
+
def setup
|
587
|
+
@player_os_package = Player::Os::Package.all.first
|
588
|
+
end
|
589
|
+
|
590
|
+
def test_valid
|
591
|
+
refute_nil(@player_os_package)
|
592
|
+
assert_instance_of(Player::Os::Package, @player_os_package)
|
593
|
+
refute_nil(@player_os_package.id)
|
594
|
+
end
|
595
|
+
|
596
|
+
def test_valid_associations
|
597
|
+
assert_instance_of(Player::Os::Package::VersionChange,
|
598
|
+
@player_os_package.version_changes.first)
|
599
|
+
assert_instance_of(Player::Os::Package::Version,
|
600
|
+
@player_os_package.versions.first)
|
601
|
+
end
|
602
|
+
|
603
|
+
end
|
604
|
+
|
605
|
+
class TestDigitalSignagePlayerOsPackageVersion < MiniTest::Test
|
606
|
+
|
607
|
+
include LWS::DigitalSignage
|
608
|
+
|
609
|
+
def setup
|
610
|
+
@player_os_package = Player::Os::Package.all.first
|
611
|
+
# Player OS package versions only exist as child object of player OS
|
612
|
+
# packages
|
613
|
+
@player_os_package_version = @player_os_package.versions.first
|
614
|
+
end
|
615
|
+
|
616
|
+
def test_valid
|
617
|
+
refute_nil(@player_os_package_version)
|
618
|
+
assert_instance_of(Player::Os::Package::Version, @player_os_package_version)
|
619
|
+
refute_nil(@player_os_package_version.id)
|
620
|
+
end
|
621
|
+
|
622
|
+
def test_valid_associations
|
623
|
+
# FIXME: Missing branch_id in LWS
|
624
|
+
#assert_instance_of(Player::Os::Branch::Release,
|
625
|
+
# @player_os_package_version.branch_releases.first)
|
626
|
+
assert_instance_of(Player::Os::Package,
|
627
|
+
@player_os_package_version.package)
|
628
|
+
assert_equal(@player_os_package, @player_os_package_version.package)
|
629
|
+
end
|
630
|
+
|
631
|
+
end
|
632
|
+
|
633
|
+
class TestDigitalSignagePlayerOsPackageVersionChange < MiniTest::Test
|
634
|
+
|
635
|
+
include LWS::DigitalSignage
|
636
|
+
|
637
|
+
def setup
|
638
|
+
@player_os_package = Player::Os::Package.all.first
|
639
|
+
# Player OS package version changes only exist as child object of
|
640
|
+
# player OS packages
|
641
|
+
@player_os_package_version_change =
|
642
|
+
@player_os_package.version_changes.first
|
643
|
+
end
|
644
|
+
|
645
|
+
def test_valid
|
646
|
+
refute_nil(@player_os_package_version_change)
|
647
|
+
assert_instance_of(Player::Os::Package::VersionChange,
|
648
|
+
@player_os_package_version_change)
|
649
|
+
refute_nil(@player_os_package_version_change.id)
|
650
|
+
end
|
651
|
+
|
652
|
+
def test_valid_associations
|
653
|
+
# FIXME: Missing branch_id in LWS
|
654
|
+
#assert_instance_of(Player::Os::Branch::Release,
|
655
|
+
# @player_os_package_version_change.branch_release)
|
656
|
+
# FIXME: This requires that version objects have been generated
|
657
|
+
if @player_os_package_version_change.from_version_id.present?
|
658
|
+
assert_instance_of(Player::Os::Package::Version,
|
659
|
+
@player_os_package_version_change.from_version)
|
660
|
+
end
|
661
|
+
assert_instance_of(Player::Os::Package,
|
662
|
+
@player_os_package_version_change.package)
|
663
|
+
assert_equal(@player_os_package, @player_os_package_version_change.package)
|
664
|
+
# FIXME: This requires that version objects have been generated
|
665
|
+
if @player_os_package_version_change.to_version_id.present?
|
666
|
+
assert_instance_of(Player::Os::Package::Version,
|
667
|
+
@player_os_package_version_change.to_version)
|
668
|
+
end
|
669
|
+
end
|
670
|
+
|
671
|
+
end
|
672
|
+
|
673
|
+
class TestDigitalSignagePlayerOsReleaseChannel < MiniTest::Test
|
674
|
+
|
675
|
+
include LWS::DigitalSignage
|
676
|
+
|
677
|
+
def setup
|
678
|
+
@player_os_release_channel =
|
679
|
+
Player::Os::ReleaseChannel.where(slug: "development").first
|
680
|
+
end
|
681
|
+
|
682
|
+
def test_valid
|
683
|
+
refute_nil(@player_os_release_channel)
|
684
|
+
assert_instance_of(Player::Os::ReleaseChannel, @player_os_release_channel)
|
685
|
+
refute_nil(@player_os_release_channel.id)
|
686
|
+
end
|
687
|
+
|
688
|
+
def test_valid_associations
|
689
|
+
assert_instance_of(Player::Os::Branch,
|
690
|
+
@player_os_release_channel.branches.first)
|
691
|
+
assert_instance_of(Player,
|
692
|
+
@player_os_release_channel.players.first)
|
693
|
+
end
|
694
|
+
|
695
|
+
end
|
696
|
+
|
697
|
+
class TestDigitalSignagePlayerPredefinedConfiguration < MiniTest::Test
|
698
|
+
|
699
|
+
include LWS::DigitalSignage
|
700
|
+
|
701
|
+
def setup
|
702
|
+
@player_predefined_configuration =
|
703
|
+
Player::PredefinedConfiguration.all.first
|
704
|
+
end
|
705
|
+
|
706
|
+
def test_valid
|
707
|
+
refute_nil(@player_predefined_configuration)
|
708
|
+
assert_instance_of(Player::PredefinedConfiguration,
|
709
|
+
@player_predefined_configuration)
|
710
|
+
refute_nil(@player_predefined_configuration.id)
|
711
|
+
end
|
712
|
+
|
713
|
+
def test_valid_associations
|
714
|
+
assert_instance_of(LWS::Auth::Company,
|
715
|
+
@player_predefined_configuration.company)
|
716
|
+
assert_instance_of(Player::Configuration,
|
717
|
+
@player_predefined_configuration.configurations.first)
|
718
|
+
assert_instance_of(Player::PredefinedConfiguration::Setting,
|
719
|
+
@player_predefined_configuration.settings.first)
|
720
|
+
end
|
721
|
+
|
722
|
+
end
|
723
|
+
|
724
|
+
class TestDigitalSignagePlayerPredefinedConfigurationSetting < MiniTest::Test
|
725
|
+
|
726
|
+
include LWS::DigitalSignage
|
727
|
+
|
728
|
+
def setup
|
729
|
+
@player_predefined_configuration =
|
730
|
+
Player::PredefinedConfiguration.all.first
|
731
|
+
# Predefined player configuration settings only exist as child objects
|
732
|
+
# of predefined player configurations
|
733
|
+
@player_predefined_configuration_setting =
|
734
|
+
@player_predefined_configuration.settings.first
|
735
|
+
end
|
736
|
+
|
737
|
+
def test_valid
|
738
|
+
refute_nil(@player_predefined_configuration_setting)
|
739
|
+
assert_instance_of(Player::PredefinedConfiguration::Setting,
|
740
|
+
@player_predefined_configuration_setting)
|
741
|
+
refute_nil(@player_predefined_configuration_setting.id)
|
742
|
+
end
|
743
|
+
|
744
|
+
def test_valid_associations
|
745
|
+
assert_instance_of(Player::PredefinedConfiguration,
|
746
|
+
@player_predefined_configuration_setting.predefined_configuration)
|
747
|
+
end
|
748
|
+
|
749
|
+
end
|
750
|
+
|
751
|
+
class TestDigitalSignagePlayerRequest < MiniTest::Test
|
752
|
+
|
753
|
+
include LWS::DigitalSignage
|
754
|
+
|
755
|
+
def setup
|
756
|
+
@player = Player.find(1)
|
757
|
+
# Player requests only exist as child objects of players
|
758
|
+
@player_request = @player.requests.first
|
759
|
+
end
|
760
|
+
|
761
|
+
def test_valid
|
762
|
+
refute_nil(@player_request)
|
763
|
+
assert_instance_of(Player::Request, @player_request)
|
764
|
+
refute_nil(@player_request.id)
|
765
|
+
end
|
766
|
+
|
767
|
+
def test_valid_associations
|
768
|
+
assert_instance_of(Player, @player_request.player)
|
769
|
+
assert_equal(@player, @player_request.player)
|
770
|
+
if @player_request.processed
|
771
|
+
if @player_request.feedback.present?
|
772
|
+
assert_instance_of(Player::Feedback, @player_request.feedback)
|
773
|
+
elsif @player_request.log.present?
|
774
|
+
assert_instance_of(Player::Log, @player_request.log)
|
775
|
+
elsif @player_request.screenshot.present?
|
776
|
+
assert_instance_of(Player::Screenshot, @player_request.screenshot)
|
777
|
+
else
|
778
|
+
fail "request should be associated either with feedback, a log or a screenshot"
|
779
|
+
end
|
780
|
+
end
|
781
|
+
end
|
782
|
+
|
783
|
+
end
|
784
|
+
|
785
|
+
class TestDigitalSignagePlayerScreenshot < MiniTest::Test
|
786
|
+
|
787
|
+
include LWS::DigitalSignage
|
788
|
+
|
789
|
+
def setup
|
790
|
+
@player = Player.find(1)
|
791
|
+
# Player screenshots only exist as child objects of players
|
792
|
+
@player_screenshot = @player.screenshots.first
|
793
|
+
end
|
794
|
+
|
795
|
+
def test_valid
|
796
|
+
refute_nil(@player_screenshot)
|
797
|
+
assert_instance_of(Player::Screenshot, @player_screenshot)
|
798
|
+
refute_nil(@player_screenshot.id)
|
799
|
+
end
|
800
|
+
|
801
|
+
def test_valid_associations
|
802
|
+
assert_instance_of(Player, @player_screenshot.player)
|
803
|
+
assert_equal(@player, @player_screenshot.player)
|
804
|
+
end
|
805
|
+
|
806
|
+
end
|
807
|
+
|
808
|
+
class TestDigitalSignagePlayerTag < MiniTest::Test
|
809
|
+
|
810
|
+
include LWS::DigitalSignage
|
811
|
+
|
812
|
+
def setup
|
813
|
+
@player = Player.find(1)
|
814
|
+
# Player tags only exist as child objects of players
|
815
|
+
@player_tag = @player.tags.first
|
816
|
+
end
|
817
|
+
|
818
|
+
def test_valid
|
819
|
+
refute_nil(@player_tag)
|
820
|
+
assert_instance_of(Player::Tag, @player_tag)
|
821
|
+
refute_nil(@player_tag.id)
|
822
|
+
end
|
823
|
+
|
824
|
+
def test_valid_associations
|
825
|
+
assert_instance_of(Player, @player_tag.player)
|
826
|
+
assert_equal(@player, @player_tag.player)
|
827
|
+
end
|
828
|
+
|
829
|
+
end
|