summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2007-12-17 21:00:56 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2007-12-17 21:00:56 +0000
commit524cd689cf8743c389aab6a767a09383891dc5c6 (patch)
tree857334f93146211c3fc88e08ca8da6e5e7437746 /test
parentb4eafd9ea8132534f75e3065c3d36345610e907a (diff)
downloadredmine-524cd689cf8743c389aab6a767a09383891dc5c6.tar.gz
redmine-524cd689cf8743c389aab6a767a09383891dc5c6.zip
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
Diffstat (limited to 'test')
-rw-r--r--test/fixtures/projects.yml2
-rw-r--r--test/functional/issues_controller_test.rb2
-rw-r--r--test/functional/projects_controller_test.rb18
-rw-r--r--test/functional/repositories_controller_test.rb4
-rw-r--r--test/functional/versions_controller_test.rb4
-rw-r--r--test/functional/wiki_controller_test.rb12
-rw-r--r--test/functional/wikis_controller_test.rb2
-rw-r--r--test/integration/issues_test.rb2
8 files changed, 27 insertions, 19 deletions
diff --git a/test/fixtures/projects.yml b/test/fixtures/projects.yml
index d3758c9e3..ad5cf4aa2 100644
--- a/test/fixtures/projects.yml
+++ b/test/fixtures/projects.yml
@@ -41,5 +41,5 @@ projects_004:
description: eCookbook Subproject 2
homepage: ""
is_public: true
- identifier: subproject1
+ identifier: subproject2
parent_id: 1
diff --git a/test/functional/issues_controller_test.rb b/test/functional/issues_controller_test.rb
index 638362dbe..ebcf78f24 100644
--- a/test/functional/issues_controller_test.rb
+++ b/test/functional/issues_controller_test.rb
@@ -144,7 +144,7 @@ class IssuesControllerTest < Test::Unit::TestCase
def test_destroy
@request.session[:user_id] = 2
post :destroy, :id => 1
- assert_redirected_to 'projects/1/issues'
+ assert_redirected_to 'projects/ecookbook/issues'
assert_nil Issue.find_by_id(1)
end
diff --git a/test/functional/projects_controller_test.rb b/test/functional/projects_controller_test.rb
index b6ac59141..556d5d407 100644
--- a/test/functional/projects_controller_test.rb
+++ b/test/functional/projects_controller_test.rb
@@ -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
diff --git a/test/functional/repositories_controller_test.rb b/test/functional/repositories_controller_test.rb
index 2f0459505..47455dc55 100644
--- a/test/functional/repositories_controller_test.rb
+++ b/test/functional/repositories_controller_test.rb
@@ -43,10 +43,10 @@ class RepositoriesControllerTest < Test::Unit::TestCase
assert_response :success
assert_template 'revision'
assert_no_tag :tag => "div", :attributes => { :class => "contextual" },
- :child => { :tag => "a", :attributes => { :href => '/repositories/revision/1?rev=0'}
+ :child => { :tag => "a", :attributes => { :href => '/repositories/revision/ecookbook?rev=0'}
}
assert_tag :tag => "div", :attributes => { :class => "contextual" },
- :child => { :tag => "a", :attributes => { :href => '/repositories/revision/1?rev=2'}
+ :child => { :tag => "a", :attributes => { :href => '/repositories/revision/ecookbook?rev=2'}
}
end
diff --git a/test/functional/versions_controller_test.rb b/test/functional/versions_controller_test.rb
index 17ebd3518..3477c5edd 100644
--- a/test/functional/versions_controller_test.rb
+++ b/test/functional/versions_controller_test.rb
@@ -52,7 +52,7 @@ class VersionsControllerTest < Test::Unit::TestCase
post :edit, :id => 2,
:version => { :name => 'New version name',
:effective_date => Date.today.strftime("%Y-%m-%d")}
- assert_redirected_to 'projects/settings/1'
+ assert_redirected_to 'projects/settings/ecookbook'
version = Version.find(2)
assert_equal 'New version name', version.name
assert_equal Date.today, version.effective_date
@@ -61,7 +61,7 @@ class VersionsControllerTest < Test::Unit::TestCase
def test_destroy
@request.session[:user_id] = 2
post :destroy, :id => 2
- assert_redirected_to 'projects/settings/1'
+ assert_redirected_to 'projects/settings/ecookbook'
assert_nil Version.find_by_id(2)
end
diff --git a/test/functional/wiki_controller_test.rb b/test/functional/wiki_controller_test.rb
index 6ee5ab276..043b0e805 100644
--- a/test/functional/wiki_controller_test.rb
+++ b/test/functional/wiki_controller_test.rb
@@ -64,7 +64,7 @@ class WikiControllerTest < Test::Unit::TestCase
:content => {:comments => 'Created the page',
:text => "h1. New page\n\nThis is a new page",
:version => 0}
- assert_redirected_to 'wiki/1/New_page'
+ assert_redirected_to 'wiki/ecookbook/New_page'
page = Project.find(1).wiki.find_page('New page')
assert !page.new_record?
assert_not_nil page.content
@@ -103,7 +103,7 @@ class WikiControllerTest < Test::Unit::TestCase
post :rename, :id => 1, :page => 'Another_page',
:wiki_page => { :title => 'Another renamed page',
:redirect_existing_links => 1 }
- assert_redirected_to 'wiki/1/Another_renamed_page'
+ assert_redirected_to 'wiki/ecookbook/Another_renamed_page'
wiki = Project.find(1).wiki
# Check redirects
assert_not_nil wiki.find_page('Another page')
@@ -115,7 +115,7 @@ class WikiControllerTest < Test::Unit::TestCase
post :rename, :id => 1, :page => 'Another_page',
:wiki_page => { :title => 'Another renamed page',
:redirect_existing_links => "0" }
- assert_redirected_to 'wiki/1/Another_renamed_page'
+ assert_redirected_to 'wiki/ecookbook/Another_renamed_page'
wiki = Project.find(1).wiki
# Check that there's no redirects
assert_nil wiki.find_page('Another page')
@@ -124,17 +124,17 @@ class WikiControllerTest < Test::Unit::TestCase
def test_destroy
@request.session[:user_id] = 2
post :destroy, :id => 1, :page => 'CookBook_documentation'
- assert_redirected_to 'wiki/1/Page_index/special'
+ assert_redirected_to 'wiki/ecookbook/Page_index/special'
end
def test_page_index
- get :special, :id => 1, :page => 'Page_index'
+ get :special, :id => 'ecookbook', :page => 'Page_index'
assert_response :success
assert_template 'special_page_index'
pages = assigns(:pages)
assert_not_nil pages
assert_equal 2, pages.size
- assert_tag :tag => 'a', :attributes => { :href => '/wiki/1/CookBook_documentation' },
+ assert_tag :tag => 'a', :attributes => { :href => '/wiki/ecookbook/CookBook_documentation' },
:content => /CookBook documentation/
end
diff --git a/test/functional/wikis_controller_test.rb b/test/functional/wikis_controller_test.rb
index 93ad7e32d..3e51314a5 100644
--- a/test/functional/wikis_controller_test.rb
+++ b/test/functional/wikis_controller_test.rb
@@ -44,7 +44,7 @@ class WikisControllerTest < Test::Unit::TestCase
def test_destroy
@request.session[:user_id] = 1
post :destroy, :id => 1, :confirm => 1
- assert_redirected_to 'projects/settings/1'
+ assert_redirected_to 'projects/settings/ecookbook'
assert_nil Project.find(1).wiki
end
diff --git a/test/integration/issues_test.rb b/test/integration/issues_test.rb
index eac407b1b..702fbc026 100644
--- a/test/integration/issues_test.rb
+++ b/test/integration/issues_test.rb
@@ -24,7 +24,7 @@ class IssuesTest < ActionController::IntegrationTest
assert_kind_of Issue, issue
# check redirection
- assert_redirected_to "projects/1/issues"
+ assert_redirected_to "projects/ecookbook/issues"
follow_redirect!
assert assigns(:issues).include?(issue)