lws 8.1.0 → 8.1.1

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