Commit 7e99e271 authored by Felix Schäfer's avatar Felix Schäfer

404 on board index when no board configured. #64

parent 9ed2d8ed
......@@ -29,6 +29,7 @@ class BoardsController < ApplicationController
def index
@boards = @project.boards
render_404 if @boards.empty?
# show the board if there is only one
if @boards.size == 1
@board = @boards.first
......
......@@ -96,4 +96,11 @@ class BoardsControllerTest < ActionController::TestCase
assert_redirected_to '/projects/ecookbook/settings/boards'
assert_nil Board.find_by_id(2)
end
def test_index_should_404_with_no_board
Project.find(1).boards.each(&:destroy)
get :index, :project_id => 1
assert_response 404
end
end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment