@@ -55,20 +55,24 @@ module PlaceOS::Model
5555 cs.playlists.size.should eq 0
5656 end
5757
58- it " finds all the playlist ids associated with a system" do
58+ it " finds all the playlist ids associated with a system" , focus: true do
5959 playlist = Generator .playlist
6060 playlist.save!
6161 play_id = playlist.id.as(String )
6262
63+ playlist = Generator .playlist
64+ playlist.save!
65+ play_id2 = playlist.id.as(String )
66+
6367 cs = Generator .control_system
64- cs.playlists = [play_id ]
68+ cs.playlists = [play_id2 ]
6569
6670 zone = Generator .zone
6771 zone.playlists = [play_id]
6872 zone.save!
6973
7074 zone2 = Generator .zone
71- zone2 .playlists = [play_id ]
75+ zone2 .playlists = [play_id2 ]
7276 zone2 .save!
7377
7478 cs.zones = [zone.id.as(String ), zone2 .id.as(String )]
@@ -80,16 +84,36 @@ module PlaceOS::Model
8084 trigger.save!
8185
8286 trigger2 = Generator .trigger_instance control_system: cs
83- trigger2.playlists = [play_id ]
87+ trigger2.playlists = [play_id2 ]
8488 trigger2.save!
8589
8690 cs = ControlSystem .find(cs_id)
8791 cs.all_playlists.should eq({
88- cs_id => [play_id],
92+ cs_id => [play_id2],
93+ zone.id.as(String ) => [play_id],
94+ zone2 .id.as(String ) => [play_id2],
95+ trigger.id.as(String ) => [play_id],
96+ trigger2.id.as(String ) => [play_id2],
97+ })
98+
99+ # playlists default to this orientation
100+ cs.orientation = PlaceOS ::Model ::Playlist ::Orientation ::Portrait
101+ cs.save!
102+ cs.all_playlists.should eq({
103+ cs_id => [play_id2],
89104 zone.id.as(String ) => [play_id],
90- zone2 .id.as(String ) => [play_id ],
105+ zone2 .id.as(String ) => [play_id2 ],
91106 trigger.id.as(String ) => [play_id],
92- trigger2.id.as(String ) => [play_id],
107+ trigger2.id.as(String ) => [play_id2],
108+ })
109+
110+ # playlists directly assigned to the display should not be filtered
111+ playlist.orientation = PlaceOS ::Model ::Playlist ::Orientation ::Landscape
112+ playlist.save!
113+ cs.all_playlists.should eq({
114+ cs_id => [play_id2],
115+ zone.id.as(String ) => [play_id],
116+ trigger.id.as(String ) => [play_id],
93117 })
94118 end
95119
0 commit comments