@@ -125,7 +125,7 class MessagesController < ApplicationController | |||||
125 |
|
125 | |||
126 | private |
|
126 | private | |
127 | def find_message |
|
127 | def find_message | |
128 | find_board |
|
128 | return unless find_board | |
129 | @message = @board.messages.find(params[:id], :include => :parent) |
|
129 | @message = @board.messages.find(params[:id], :include => :parent) | |
130 | @topic = @message.root |
|
130 | @topic = @message.root | |
131 | rescue ActiveRecord::RecordNotFound |
|
131 | rescue ActiveRecord::RecordNotFound | |
@@ -137,5 +137,6 private | |||||
137 | @project = @board.project |
|
137 | @project = @board.project | |
138 | rescue ActiveRecord::RecordNotFound |
|
138 | rescue ActiveRecord::RecordNotFound | |
139 | render_404 |
|
139 | render_404 | |
|
140 | nil | |||
140 | end |
|
141 | end | |
141 | end |
|
142 | end |
@@ -74,6 +74,11 class MessagesControllerTest < ActionController::TestCase | |||||
74 | assert_response 404 |
|
74 | assert_response 404 | |
75 | end |
|
75 | end | |
76 |
|
76 | |||
|
77 | def test_show_message_from_invalid_board_should_respond_with_404 | |||
|
78 | get :show, :board_id => 999, :id => 1 | |||
|
79 | assert_response 404 | |||
|
80 | end | |||
|
81 | ||||
77 | def test_get_new |
|
82 | def test_get_new | |
78 | @request.session[:user_id] = 2 |
|
83 | @request.session[:user_id] = 2 | |
79 | get :new, :board_id => 1 |
|
84 | get :new, :board_id => 1 |
General Comments 0
You need to be logged in to leave comments.
Login now