Commit d76b9e3bfc2c63c829e4c2ee85d405f9918a74d1
1 parent
18a99bd2
Exists in
master
and in
29 other branches
Don't crash if referenced image gallery is deleted
(ActionItem1494)
Showing
2 changed files
with
5 additions
and
1 deletions
Show diff stats
app/models/slideshow_block.rb
test/unit/slideshow_block_test.rb
| ... | ... | @@ -15,6 +15,10 @@ class SlideshowBlockTest < ActiveSupport::TestCase |
| 15 | 15 | assert_equal gallery, slideshow_block.gallery |
| 16 | 16 | end |
| 17 | 17 | |
| 18 | + should 'not crash if referencing unexisting folder' do | |
| 19 | + assert_nil SlideshowBlock.new(:gallery_id => -999).gallery | |
| 20 | + end | |
| 21 | + | |
| 18 | 22 | should 'default interval between transitions is 4 seconds' do |
| 19 | 23 | slideshow = SlideshowBlock.new |
| 20 | 24 | assert_equal 4, slideshow.interval | ... | ... |