Commit 17dff5dd289cacb2a4e4cce9a422604c3e961358
Exists in
staging
and in
42 other branches
Merge branch 'block_limit' into 'master'
blocks: make sure limit is integer on get_limit Blocks configured before the definition of limit type were strings and were crashing See merge request !558
Showing
2 changed files
with
8 additions
and
1 deletions
Show diff stats
app/models/block.rb
test/unit/block_test.rb
| ... | ... | @@ -330,4 +330,11 @@ class BlockTest < ActiveSupport::TestCase |
| 330 | 330 | block.save! |
| 331 | 331 | assert !block.display_to_user?(person_friend) |
| 332 | 332 | end |
| 333 | + | |
| 334 | + should 'get limit as a number when limit is string' do | |
| 335 | + block = RecentDocumentsBlock.new | |
| 336 | + block.settings[:limit] = '5' | |
| 337 | + assert block.get_limit.is_a?(Fixnum) | |
| 338 | + end | |
| 339 | + | |
| 333 | 340 | end | ... | ... |