summaryrefslogtreecommitdiffstats
path: root/test/functional/documents_controller_test.rb
diff options
context:
space:
mode:
authorEric Davis <edavis@littlestreamsoftware.com>2010-06-19 22:17:34 +0000
committerEric Davis <edavis@littlestreamsoftware.com>2010-06-19 22:17:34 +0000
commit093853b56a5e988d1087dbcb5d3b28bfe153c8a5 (patch)
tree910c64676fd0300652deab3919a571875b9f32f5 /test/functional/documents_controller_test.rb
parentb10818f4a1c1858d9943c94c0359160ef3bfe482 (diff)
downloadredmine-093853b56a5e988d1087dbcb5d3b28bfe153c8a5.tar.gz
redmine-093853b56a5e988d1087dbcb5d3b28bfe153c8a5.zip
Added tests for #5533's behavior.
Contributed by Gregor Schmidt. git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@3788 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/functional/documents_controller_test.rb')
-rw-r--r--test/functional/documents_controller_test.rb18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/functional/documents_controller_test.rb b/test/functional/documents_controller_test.rb
index 65afc229c..a1ce7ea77 100644
--- a/test/functional/documents_controller_test.rb
+++ b/test/functional/documents_controller_test.rb
@@ -47,6 +47,24 @@ 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 => <<LOREM)
+Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut egestas, mi vehicula varius varius, ipsum massa fermentum orci, eget tristique ante sem vel mi. Nulla facilisi. Donec enim libero, luctus ac sagittis sit amet, vehicula sagittis magna. Duis ultrices molestie ante, eget scelerisque sem iaculis vitae. Etiam fermentum mauris vitae metus pharetra condimentum fermentum est pretium. Proin sollicitudin elementum quam quis pharetra. Aenean facilisis nunc quis elit volutpat mollis. Aenean eleifend varius euismod. Ut dolor est, congue eget dapibus eget, elementum eu odio. Integer et lectus neque, nec scelerisque nisi. EndOfLineHere
+
+Vestibulum non velit mi. Aliquam scelerisque libero ut nulla fringilla a sollicitudin magna rhoncus. Praesent a nunc lorem, ac porttitor eros. Sed ac diam nec neque interdum adipiscing quis quis justo. Donec arcu nunc, fringilla eu dictum at, venenatis ac sem. Vestibulum quis elit urna, ac mattis sapien. Lorem ipsum dolor sit amet, consectetur adipiscing elit.
+LOREM
+
+ get :index, :project_id => 'ecookbook'
+ assert_response :success
+ assert_template 'index'
+
+ # should only truncate on new lines to avoid breaking wiki formatting
+ assert_select '.wiki p', :text => (doc.description.split("\n").first + '...')
+ assert_select '.wiki p', :text => Regexp.new(Regexp.escape("EndOfLineHere..."))
+ end
+
def test_new_with_one_attachment
ActionMailer::Base.deliveries.clear
Setting.notified_events << 'document_added'