File tree Expand file tree Collapse file tree 3 files changed +12
-2
lines changed
app/cells/decidim/alternative_landing/content_blocks/stack_horizontal Expand file tree Collapse file tree 3 files changed +12
-2
lines changed Original file line number Diff line number Diff line change 88 <% 1 . upto ( 3 ) do |item_number | %>
99 < div class ="stack-item ">
1010 < div class ="stack-image ">
11- <%= image_tag image ( item_number ) %>
11+ <%= image_tag image ( item_number ) if image ( item_number ) . present? %>
1212 </ div >
1313 < div class ="stack-body ">
1414 < div >
Original file line number Diff line number Diff line change 1919 # /rails/active_storage/representation/redirect/same-hash--different-token/same-file-name
2020 # That's why we are splitting by "--" and comparing the first
2121 img_path = content_block . images_container . attached_uploader ( "image_#{ item_number } " . to_sym ) . path ( variant : :landscape )
22- [ img_path . split ( "--" ) . first , img_path . split ( "/" ) . last ] . each do |regex |
22+ img_path && [ img_path . split ( "--" ) . first , img_path . split ( "/" ) . last ] . each do |regex |
2323 expect ( page . find ( "img" ) [ :src ] ) . to match ( /#{ regex } / )
2424 end
2525 end
Original file line number Diff line number Diff line change 5151 describe "stack blocks" do
5252 it_behaves_like "render all stack block elements" , "stack-horizontal"
5353 it_behaves_like "render all stack block elements" , "stack-vertical"
54+
55+ context "without images" do
56+ before do
57+ stack_horizontal_block . attachments . destroy_all
58+ stack_vertical_block . attachments . destroy_all
59+ end
60+
61+ it_behaves_like "render all stack block elements" , "stack-horizontal"
62+ it_behaves_like "render all stack block elements" , "stack-vertical"
63+ end
5464 end
5565
5666 describe "tiles block" do
You can’t perform that action at this time.
0 commit comments