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