summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2009-01-04 18:14:51 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2009-01-04 18:14:51 +0000
commitcd83f72da47f0b6e93a69de04f582c18fca20df8 (patch)
treebb1f945d795667407388db98044a257aeac5bd80
parent260373aed71ede51f4bc46e34283dd66b8be1cd8 (diff)
downloadredmine-cd83f72da47f0b6e93a69de04f582c18fca20df8.tar.gz
redmine-cd83f72da47f0b6e93a69de04f582c18fca20df8.zip
Slight changes in functional tests.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@2235 e93f8b46-1217-0410-a6f0-8f06a7374b81
-rw-r--r--test/functional/admin_controller_test.rb2
-rw-r--r--test/functional/attachments_controller_test.rb4
-rw-r--r--test/functional/issues_controller_test.rb9
-rw-r--r--test/functional/timelog_controller_test.rb2
-rw-r--r--test/functional/users_controller_test.rb4
-rw-r--r--test/functional/versions_controller_test.rb4
-rw-r--r--test/functional/wiki_controller_test.rb2
-rw-r--r--test/functional/wikis_controller_test.rb2
-rw-r--r--test/functional/workflows_controller_test.rb2
9 files changed, 16 insertions, 15 deletions
diff --git a/test/functional/admin_controller_test.rb b/test/functional/admin_controller_test.rb
index 569ed5589..a9c45aae3 100644
--- a/test/functional/admin_controller_test.rb
+++ b/test/functional/admin_controller_test.rb
@@ -72,7 +72,7 @@ class AdminControllerTest < Test::Unit::TestCase
def test_test_email
get :test_email
- assert_redirected_to 'settings/edit'
+ assert_redirected_to '/settings/edit?tab=notifications'
mail = ActionMailer::Base.deliveries.last
assert_kind_of TMail::Mail, mail
user = User.find(1)
diff --git a/test/functional/attachments_controller_test.rb b/test/functional/attachments_controller_test.rb
index c60a4a0e0..634d4279b 100644
--- a/test/functional/attachments_controller_test.rb
+++ b/test/functional/attachments_controller_test.rb
@@ -75,7 +75,7 @@ class AttachmentsControllerTest < Test::Unit::TestCase
def test_anonymous_on_private_private
get :download, :id => 7
- assert_redirected_to 'account/login'
+ assert_redirected_to '/login?back_url=http%3A%2F%2Ftest.host%2Fattachments%2Fdownload%2F7'
end
def test_destroy_issue_attachment
@@ -120,7 +120,7 @@ class AttachmentsControllerTest < Test::Unit::TestCase
def test_destroy_without_permission
post :destroy, :id => 3
- assert_redirected_to '/login'
+ assert_redirected_to '/login?back_url=http%3A%2F%2Ftest.host%2Fattachments%2Fdestroy%2F3'
assert Attachment.find_by_id(3)
end
end
diff --git a/test/functional/issues_controller_test.rb b/test/functional/issues_controller_test.rb
index 15d95d11c..a44779fa4 100644
--- a/test/functional/issues_controller_test.rb
+++ b/test/functional/issues_controller_test.rb
@@ -301,7 +301,7 @@ class IssuesControllerTest < Test::Unit::TestCase
:priority_id => 5,
:estimated_hours => '',
:custom_field_values => {'2' => 'Value for field 2'}}
- assert_redirected_to 'issues/show'
+ assert_redirected_to :controller => 'issues', :action => 'show'
issue = Issue.find_by_subject('This is the test_new issue')
assert_not_nil issue
@@ -320,7 +320,7 @@ class IssuesControllerTest < Test::Unit::TestCase
:subject => 'This is the test_new issue',
:description => 'This is the description',
:priority_id => 5}
- assert_redirected_to 'issues/show'
+ assert_redirected_to :controller => 'issues', :action => 'show'
end
def test_post_new_with_required_custom_field_and_without_custom_fields_param
@@ -352,9 +352,10 @@ class IssuesControllerTest < Test::Unit::TestCase
:priority_id => 5,
:watcher_user_ids => ['2', '3']}
end
- assert_redirected_to 'issues/show'
-
issue = Issue.find_by_subject('This is a new issue with watchers')
+ assert_not_nil issue
+ assert_redirected_to :controller => 'issues', :action => 'show', :id => issue
+
# Watchers added
assert_equal [2, 3], issue.watcher_user_ids.sort
assert issue.watched_by?(User.find(3))
diff --git a/test/functional/timelog_controller_test.rb b/test/functional/timelog_controller_test.rb
index 28f2a28e2..a83de5db0 100644
--- a/test/functional/timelog_controller_test.rb
+++ b/test/functional/timelog_controller_test.rb
@@ -103,7 +103,7 @@ class TimelogControllerTest < Test::Unit::TestCase
r.permissions_will_change!
r.save
get :report
- assert_redirected_to '/account/login'
+ assert_redirected_to '/login?back_url=http%3A%2F%2Ftest.host%2Ftimelog%2Freport'
end
def test_report_all_projects_one_criteria
diff --git a/test/functional/users_controller_test.rb b/test/functional/users_controller_test.rb
index c774c164c..82f3e9ee2 100644
--- a/test/functional/users_controller_test.rb
+++ b/test/functional/users_controller_test.rb
@@ -60,13 +60,13 @@ class UsersControllerTest < Test::Unit::TestCase
def test_edit_membership
post :edit_membership, :id => 2, :membership_id => 1,
:membership => { :role_id => 2}
- assert_redirected_to 'users/edit/2'
+ assert_redirected_to '/users/edit/2?tab=memberships'
assert_equal 2, Member.find(1).role_id
end
def test_destroy_membership
post :destroy_membership, :id => 2, :membership_id => 1
- assert_redirected_to 'users/edit/2'
+ assert_redirected_to '/users/edit/2?tab=memberships'
assert_nil Member.find_by_id(1)
end
end
diff --git a/test/functional/versions_controller_test.rb b/test/functional/versions_controller_test.rb
index 3a118701a..562a57dd8 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/ecookbook'
+ assert_redirected_to '/projects/settings/ecookbook?tab=versions'
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 => 3
- assert_redirected_to 'projects/settings/ecookbook'
+ assert_redirected_to '/projects/settings/ecookbook?tab=versions'
assert_nil Version.find_by_id(3)
end
diff --git a/test/functional/wiki_controller_test.rb b/test/functional/wiki_controller_test.rb
index 5b2574128..d47a4ff47 100644
--- a/test/functional/wiki_controller_test.rb
+++ b/test/functional/wiki_controller_test.rb
@@ -210,7 +210,7 @@ class WikiControllerTest < Test::Unit::TestCase
assert page.protected?
@request.session[:user_id] = 2
post :protect, :id => 1, :page => page.title, :protected => '0'
- assert_redirected_to 'wiki/ecookbook'
+ assert_redirected_to '/wiki/ecookbook/CookBook_documentation'
assert !page.reload.protected?
end
diff --git a/test/functional/wikis_controller_test.rb b/test/functional/wikis_controller_test.rb
index 3e51314a5..9dc8c7226 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/ecookbook'
+ assert_redirected_to '/projects/settings/ecookbook?tab=wiki'
assert_nil Project.find(1).wiki
end
diff --git a/test/functional/workflows_controller_test.rb b/test/functional/workflows_controller_test.rb
index 8630f6351..d6078bbb9 100644
--- a/test/functional/workflows_controller_test.rb
+++ b/test/functional/workflows_controller_test.rb
@@ -68,7 +68,7 @@ class WorkflowsControllerTest < Test::Unit::TestCase
def test_post_edit
post :edit, :role_id => 2, :tracker_id => 1, :issue_status => {'4' => ['5'], '3' => ['1', '2']}
- assert_redirected_to 'workflows/edit'
+ assert_redirected_to '/workflows/edit?role_id=2&tracker_id=1'
assert_equal 3, Workflow.count(:conditions => {:tracker_id => 1, :role_id => 2})
assert_not_nil Workflow.find(:first, :conditions => {:role_id => 2, :tracker_id => 1, :old_status_id => 3, :new_status_id => 2})