Fixed that issue notes preview is broken by r10547 (#1554).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10585 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
c4e040fa88
commit
5a02dcf0a9
|
@ -26,7 +26,7 @@ class PreviewsController < ApplicationController
|
||||||
if @description && @description.gsub(/(\r?\n|\n\r?)/, "\n") == @issue.description.to_s.gsub(/(\r?\n|\n\r?)/, "\n")
|
if @description && @description.gsub(/(\r?\n|\n\r?)/, "\n") == @issue.description.to_s.gsub(/(\r?\n|\n\r?)/, "\n")
|
||||||
@description = nil
|
@description = nil
|
||||||
end
|
end
|
||||||
@notes = params[:notes]
|
@notes = (params[:issue] ? params[:issue][:notes] : nil)
|
||||||
else
|
else
|
||||||
@description = (params[:issue] ? params[:issue][:description] : nil)
|
@description = (params[:issue] ? params[:issue][:description] : nil)
|
||||||
end
|
end
|
||||||
|
|
|
@ -40,8 +40,7 @@ class PreviewsControllerTest < ActionController::TestCase
|
||||||
def test_preview_issue_notes
|
def test_preview_issue_notes
|
||||||
@request.session[:user_id] = 2
|
@request.session[:user_id] = 2
|
||||||
post :issue, :project_id => '1', :id => 1,
|
post :issue, :project_id => '1', :id => 1,
|
||||||
:issue => {:description => Issue.find(1).description},
|
:issue => {:description => Issue.find(1).description, :notes => 'Foo'}
|
||||||
:notes => 'Foo'
|
|
||||||
assert_response :success
|
assert_response :success
|
||||||
assert_template 'preview'
|
assert_template 'preview'
|
||||||
assert_not_nil assigns(:notes)
|
assert_not_nil assigns(:notes)
|
||||||
|
@ -49,7 +48,7 @@ class PreviewsControllerTest < ActionController::TestCase
|
||||||
|
|
||||||
def test_preview_journal_notes_for_update
|
def test_preview_journal_notes_for_update
|
||||||
@request.session[:user_id] = 2
|
@request.session[:user_id] = 2
|
||||||
post :issue, :project_id => '1', :id => 1, :notes => 'Foo'
|
post :issue, :project_id => '1', :id => 1, :issue => {:notes => 'Foo'}
|
||||||
assert_response :success
|
assert_response :success
|
||||||
assert_template 'preview'
|
assert_template 'preview'
|
||||||
assert_not_nil assigns(:notes)
|
assert_not_nil assigns(:notes)
|
||||||
|
|
Loading…
Reference in New Issue