Project identifier is now used in URLs (instead of project id).

URLs with a project id will still be recognized.

git-svn-id: http://redmine.rubyforge.org/svn/trunk@1007 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang
2007-12-17 21:00:56 +00:00
parent b4eafd9ea8
commit 524cd689cf
9 changed files with 41 additions and 19 deletions
+13 -5
View File
@@ -47,12 +47,20 @@ class ProjectsControllerTest < Test::Unit::TestCase
assert assigns(:project_tree)[Project.find(1)].include?(Project.find(3))
end
def test_show
def test_show_by_id
get :show, :id => 1
assert_response :success
assert_template 'show'
assert_not_nil assigns(:project)
end
def test_show_by_identifier
get :show, :id => 'ecookbook'
assert_response :success
assert_template 'show'
assert_not_nil assigns(:project)
assert_equal Project.find_by_identifier('ecookbook'), assigns(:project)
end
def test_settings
@request.session[:user_id] = 2 # manager
@@ -64,7 +72,7 @@ class ProjectsControllerTest < Test::Unit::TestCase
def test_edit
@request.session[:user_id] = 2 # manager
post :edit, :id => 1, :project => {:name => 'Test changed name'}
assert_redirected_to 'projects/settings/1'
assert_redirected_to 'projects/settings/ecookbook'
project = Project.find(1)
assert_equal 'Test changed name', project.name
end
@@ -104,7 +112,7 @@ class ProjectsControllerTest < Test::Unit::TestCase
def test_move_issues_to_another_project
@request.session[:user_id] = 1
post :move_issues, :id => 1, :issue_ids => [1, 2], :new_project_id => 2
assert_redirected_to 'projects/1/issues'
assert_redirected_to 'projects/ecookbook/issues'
assert_equal 2, Issue.find(1).project_id
assert_equal 2, Issue.find(2).project_id
end
@@ -112,7 +120,7 @@ class ProjectsControllerTest < Test::Unit::TestCase
def test_move_issues_to_another_tracker
@request.session[:user_id] = 1
post :move_issues, :id => 1, :issue_ids => [1, 2], :new_tracker_id => 3
assert_redirected_to 'projects/1/issues'
assert_redirected_to 'projects/ecookbook/issues'
assert_equal 3, Issue.find(1).tracker_id
assert_equal 3, Issue.find(2).tracker_id
end
@@ -242,7 +250,7 @@ class ProjectsControllerTest < Test::Unit::TestCase
assert_response :success
assert_template 'add_issue'
post :add_issue, :id => 1, :issue => {:tracker_id => 1, :subject => 'This is the test_add_issue issue', :description => 'This is the description', :priority_id => 5}
assert_redirected_to 'projects/1/issues'
assert_redirected_to 'projects/ecookbook/issues'
assert Issue.find_by_subject('This is the test_add_issue issue')
end