Commits

Anonymous committed 2090731

Fixed that issue notes preview is broken by r10547 (#1554).

Comments (0)

Files changed (2)

app/controllers/previews_controller.rb

       if @description && @description.gsub(/(\r?\n|\n\r?)/, "\n") == @issue.description.to_s.gsub(/(\r?\n|\n\r?)/, "\n")
         @description = nil
       end
-      @notes = params[:notes]
+      @notes = (params[:issue] ? params[:issue][:notes] : nil)
     else
       @description = (params[:issue] ? params[:issue][:description] : nil)
     end

test/functional/previews_controller_test.rb

   def test_preview_issue_notes
     @request.session[:user_id] = 2
     post :issue, :project_id => '1', :id => 1,
-         :issue => {:description => Issue.find(1).description},
-         :notes => 'Foo'
+         :issue => {:description => Issue.find(1).description, :notes => 'Foo'}
     assert_response :success
     assert_template 'preview'
     assert_not_nil assigns(:notes)
 
   def test_preview_journal_notes_for_update
     @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_template 'preview'
     assert_not_nil assigns(:notes)