@@ -123,7 +123,7 class MessagesController < ApplicationController | |||||
123 |
|
123 | |||
124 | private |
|
124 | private | |
125 | def find_message |
|
125 | def find_message | |
126 | find_board |
|
126 | return unless find_board | |
127 | @message = @board.messages.find(params[:id], :include => :parent) |
|
127 | @message = @board.messages.find(params[:id], :include => :parent) | |
128 | @topic = @message.root |
|
128 | @topic = @message.root | |
129 | rescue ActiveRecord::RecordNotFound |
|
129 | rescue ActiveRecord::RecordNotFound | |
@@ -135,5 +135,6 private | |||||
135 | @project = @board.project |
|
135 | @project = @board.project | |
136 | rescue ActiveRecord::RecordNotFound |
|
136 | rescue ActiveRecord::RecordNotFound | |
137 | render_404 |
|
137 | render_404 | |
|
138 | nil | |||
138 | end |
|
139 | end | |
139 | end |
|
140 | end |
@@ -81,6 +81,11 class MessagesControllerTest < ActionController::TestCase | |||||
81 | assert_response 404 |
|
81 | assert_response 404 | |
82 | end |
|
82 | end | |
83 |
|
83 | |||
|
84 | def test_show_message_from_invalid_board_should_respond_with_404 | |||
|
85 | get :show, :board_id => 999, :id => 1 | |||
|
86 | assert_response 404 | |||
|
87 | end | |||
|
88 | ||||
84 | def test_get_new |
|
89 | def test_get_new | |
85 | @request.session[:user_id] = 2 |
|
90 | @request.session[:user_id] = 2 | |
86 | get :new, :board_id => 1 |
|
91 | get :new, :board_id => 1 |
General Comments 0
You need to be logged in to leave comments.
Login now