Commit 7f3da1f1f310e50282bf7ef3f5c973a0724e67d5
Committed by
Antonio Terceiro
1 parent
b0660bd6
Exists in
master
and in
23 other branches
ActionItem1146: limit has a default and must be a number
Showing
2 changed files
with
11 additions
and
1 deletions
Show diff stats
app/models/recent_documents_block.rb
test/unit/recent_documents_block_test.rb
| ... | ... | @@ -44,6 +44,16 @@ class RecentDocumentsBlockTest < Test::Unit::TestCase |
| 44 | 44 | assert_no_match /href=.*\/testinguser\/first/, output |
| 45 | 45 | end |
| 46 | 46 | |
| 47 | + should 'store limit as a number' do | |
| 48 | + block.limit = '' | |
| 49 | + assert block.limit.is_a?(Fixnum) | |
| 50 | + end | |
| 51 | + | |
| 52 | + should 'have a non-zero default' do | |
| 53 | + block.limit = nil | |
| 54 | + assert block.limit > 0 | |
| 55 | + end | |
| 56 | + | |
| 47 | 57 | should 'display a link to sitemap with title "All content"' do |
| 48 | 58 | expects(:link_to).with('All content', :controller => 'profile', :action => 'sitemap', :profile => profile.identifier) |
| 49 | 59 | expects(:_).with('All content').returns('All content') | ... | ... |