summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2012-12-15 07:49:31 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2012-12-15 07:49:31 +0000
commit3717fdfa79419b66941452e9835a127c01cbac9d (patch)
tree50051563833a1032352dc3ad65a4c9d3c4bdf4a4
parent9d3d932703ad69f31c4c89b00c652b3be6584fd0 (diff)
downloadredmine-3717fdfa79419b66941452e9835a127c01cbac9d.tar.gz
redmine-3717fdfa79419b66941452e9835a127c01cbac9d.zip
Merged r10975 from trunk (#12566).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/2.2-stable@11002 e93f8b46-1217-0410-a6f0-8f06a7374b81
-rw-r--r--app/controllers/previews_controller.rb3
-rw-r--r--test/functional/previews_controller_test.rb2
2 files changed, 3 insertions, 2 deletions
diff --git a/app/controllers/previews_controller.rb b/app/controllers/previews_controller.rb
index af2bc7504..9594a9fe1 100644
--- a/app/controllers/previews_controller.rb
+++ b/app/controllers/previews_controller.rb
@@ -26,7 +26,8 @@ class PreviewsController < ApplicationController
if @description && @description.gsub(/(\r?\n|\n\r?)/, "\n") == @issue.description.to_s.gsub(/(\r?\n|\n\r?)/, "\n")
@description = nil
end
- @notes = (params[:issue] ? params[:issue][:notes] : nil)
+ # params[:notes] is useful for preview of notes in issue history
+ @notes = params[:notes] || (params[:issue] ? params[:issue][:notes] : nil)
else
@description = (params[:issue] ? params[:issue][:description] : nil)
end
diff --git a/test/functional/previews_controller_test.rb b/test/functional/previews_controller_test.rb
index 27739ca11..83e2dd473 100644
--- a/test/functional/previews_controller_test.rb
+++ b/test/functional/previews_controller_test.rb
@@ -48,7 +48,7 @@ class PreviewsControllerTest < ActionController::TestCase
def test_preview_journal_notes_for_update
@request.session[:user_id] = 2
- post :issue, :project_id => '1', :id => 1, :issue => {:notes => 'Foo'}
+ post :issue, :project_id => '1', :id => 1, :notes => 'Foo'
assert_response :success
assert_template 'preview'
assert_not_nil assigns(:notes)