Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
O
OHR Support
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
97
Issues
97
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
OHR Support
Commits
7e99e271
Commit
7e99e271
authored
Feb 24, 2011
by
Felix Schäfer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
404 on board index when no board configured.
#64
parent
9ed2d8ed
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
0 deletions
+8
-0
boards_controller.rb
app/controllers/boards_controller.rb
+1
-0
boards_controller_test.rb
test/functional/boards_controller_test.rb
+7
-0
No files found.
app/controllers/boards_controller.rb
View file @
7e99e271
...
@@ -29,6 +29,7 @@ class BoardsController < ApplicationController
...
@@ -29,6 +29,7 @@ class BoardsController < ApplicationController
def
index
def
index
@boards
=
@project
.
boards
@boards
=
@project
.
boards
render_404
if
@boards
.
empty?
# show the board if there is only one
# show the board if there is only one
if
@boards
.
size
==
1
if
@boards
.
size
==
1
@board
=
@boards
.
first
@board
=
@boards
.
first
...
...
test/functional/boards_controller_test.rb
View file @
7e99e271
...
@@ -96,4 +96,11 @@ class BoardsControllerTest < ActionController::TestCase
...
@@ -96,4 +96,11 @@ class BoardsControllerTest < ActionController::TestCase
assert_redirected_to
'/projects/ecookbook/settings/boards'
assert_redirected_to
'/projects/ecookbook/settings/boards'
assert_nil
Board
.
find_by_id
(
2
)
assert_nil
Board
.
find_by_id
(
2
)
end
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
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment