diff --git a/app/views/documents/show.html.erb b/app/views/documents/show.html.erb
index 8e0e390d6b..b1034b6298 100644
--- a/app/views/documents/show.html.erb
+++ b/app/views/documents/show.html.erb
@@ -35,14 +35,14 @@ See doc/COPYRIGHT.rdoc for more details.
subtitle: "#{@document.category.name} - #{format_date @document.created_on}" do %>
<% if authorize_for(:documents, :edit) %>
- <%= link_to({:controller => '/documents', :action => 'edit', :id => @document}, class: 'button', accesskey: accesskey(:edit)) do %>
+ <%= link_to({controller: '/documents', action: 'edit', id: @document}, class: 'button', accesskey: accesskey(:edit)) do %>
<%= l(:button_edit) %>
<% end %>
<% end %>
<% if authorize_for(:documents, :destroy) %>
- <%= link_to({:controller => '/documents', :action => 'destroy', :id => @document}, class: 'button', data: { :confirm => l(:text_are_you_sure) }, :method => :delete) do %>
+ <%= link_to({controller: '/documents', action: 'destroy', id: @document}, class: 'button', data: { confirm: l(:text_are_you_sure) }, method: :delete) do %>
<%= l(:button_delete) %>
<% end %>
@@ -50,18 +50,18 @@ See doc/COPYRIGHT.rdoc for more details.
<% end %>
-<%= textilizable @document.description, :attachments => @document.attachments %>
+<%= format_text @document.description, attachments: @document.attachments %>
<%= l(:label_attachment_plural) %>
<%= link_to_attachments @document %>
<% if authorize_for('documents', 'add_attachment') %>
-<%= link_to l(:label_attachment_new), {}, :onclick => "Element.show('add_attachment_form'); Element.hide(this); Element.scrollTo('add_attachment_form'); return false;",
- :id => 'attach_files_link' %>
- <%= form_tag(add_attachment_document_path(@document), method: :post, multipart: true, :id => "add_attachment_form", :style => "display:none;") do %>
+<%= link_to l(:label_attachment_new), {}, onclick: "Element.show('add_attachment_form'); Element.hide(this); Element.scrollTo('add_attachment_form'); return false;",
+ id: 'attach_files_link' %>
+ <%= form_tag(add_attachment_document_path(@document), method: :post, multipart: true, id: "add_attachment_form", style: "display:none;") do %>
-
<%= render :partial => 'attachments/form' %>
+
<%= render partial: 'attachments/form' %>
<%= styled_button_tag l(:button_add), class: "-highlight -with-icon icon-checkmark" %>
diff --git a/spec/controllers/documents_controller_spec.rb b/spec/controllers/documents_controller_spec.rb
index b849c096eb..6f9c70c853 100644
--- a/spec/controllers/documents_controller_spec.rb
+++ b/spec/controllers/documents_controller_spec.rb
@@ -53,14 +53,25 @@ describe DocumentsController do
end
describe "index" do
+ let(:long_description) {
+ <<-LOREM.strip_heredoc
+ 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
+
+ Praesent a nunc lorem, ac porttitor eros.
+ LOREM
+ }
before do
- document.update_attributes(description:<