diff --git a/test/functional/documents_controller_test.rb b/test/functional/documents_controller_test.rb index 65afc22..adad7ba 100644 --- a/test/functional/documents_controller_test.rb +++ b/test/functional/documents_controller_test.rb @@ -47,6 +47,26 @@ class DocumentsControllerTest < ActionController::TestCase :content => 'Technical documentation'} end + def test_index_with_long_description + # adds a long description to the first document + doc = documents(:documents_001) + doc.update_attributes(:description => < 'ecookbook' + assert_response :success + assert_template 'index' + File.open('/tmp/redmine.html', 'w') do |f| + f.puts @response.body + end + + # should only truncate on new lines to avoid breaking wiki formatting + assert_select '.wiki p', :text => (doc.description.split("\n").first + '...') + end + def test_new_with_one_attachment ActionMailer::Base.deliveries.clear Setting.notified_events << 'document_added'