Merged r11446 from trunk (#13232).

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/2.2-stable@11596 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang 2013-03-11 18:30:20 +00:00
parent f09ea7b65a
commit c2eb28b901
2 changed files with 7 additions and 1 deletions

View File

@ -123,7 +123,7 @@ class MessagesController < ApplicationController
private
def find_message
find_board
return unless find_board
@message = @board.messages.find(params[:id], :include => :parent)
@topic = @message.root
rescue ActiveRecord::RecordNotFound
@ -135,5 +135,6 @@ private
@project = @board.project
rescue ActiveRecord::RecordNotFound
render_404
nil
end
end

View File

@ -81,6 +81,11 @@ class MessagesControllerTest < ActionController::TestCase
assert_response 404
end
def test_show_message_from_invalid_board_should_respond_with_404
get :show, :board_id => 999, :id => 1
assert_response 404
end
def test_get_new
@request.session[:user_id] = 2
get :new, :board_id => 1