Commit 3da73df79b708e5b575bd8c343b8eb84cf94bf20
Committed by
Daniela Feitosa
1 parent
1bcd568e
Exists in
master
and in
29 other branches
Fixing uploaded_file first_paragraph
(ActionItem1760)
Showing
2 changed files
with
16 additions
and
0 deletions
Show diff stats
app/models/uploaded_file.rb
test/unit/uploaded_file_test.rb
| ... | ... | @@ -275,4 +275,16 @@ class UploadedFileTest < Test::Unit::TestCase |
| 275 | 275 | assert_nil ActionTracker::Record.last(:conditions => { :verb => "upload_image" }) |
| 276 | 276 | end |
| 277 | 277 | |
| 278 | + should 'not crash if first paragraph called' do | |
| 279 | + f = fast_create(UploadedFile) | |
| 280 | + assert_nothing_raised do | |
| 281 | + f.first_paragraph | |
| 282 | + end | |
| 283 | + end | |
| 284 | + | |
| 285 | + should 'return empty string to lead if no abstract given' do | |
| 286 | + f = fast_create(UploadedFile, :abstract => nil) | |
| 287 | + assert_equal '', f.lead | |
| 288 | + end | |
| 289 | + | |
| 278 | 290 | end | ... | ... |