summaryrefslogtreecommitdiffstats
path: root/test/integration
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2009-02-21 11:04:50 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2009-02-21 11:04:50 +0000
commitfe28193e4eb9af2dc5262535a29ffde5249568fc (patch)
treebd4cf3a9fbada98e58e510ca0e25c42bf00676a7 /test/integration
parent9a986ac0a51fe844eee816325e6a6d4122136d9a (diff)
downloadredmine-fe28193e4eb9af2dc5262535a29ffde5249568fc.tar.gz
redmine-fe28193e4eb9af2dc5262535a29ffde5249568fc.zip
Merged Rails 2.2 branch. Redmine now requires Rails 2.2.2.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@2493 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/integration')
-rw-r--r--test/integration/account_test.rb14
-rw-r--r--test/integration/admin_test.rb4
-rw-r--r--test/integration/application_test.rb6
-rw-r--r--test/integration/issues_test.rb2
4 files changed, 14 insertions, 12 deletions
diff --git a/test/integration/account_test.rb b/test/integration/account_test.rb
index c6cfd080e..5c6f1cebd 100644
--- a/test/integration/account_test.rb
+++ b/test/integration/account_test.rb
@@ -29,7 +29,7 @@ class AccountTest < ActionController::IntegrationTest
# Replace this with your real tests.
def test_login
get "my/page"
- assert_redirected_to "account/login"
+ assert_redirected_to "/login?back_url=http%3A%2F%2Fwww.example.com%2Fmy%2Fpage"
log_user('jsmith', 'jsmith')
get "my/account"
@@ -45,7 +45,7 @@ class AccountTest < ActionController::IntegrationTest
assert_template "account/lost_password"
post "account/lost_password", :mail => 'jSmith@somenet.foo'
- assert_redirected_to "account/login"
+ assert_redirected_to "/login"
token = Token.find(:first)
assert_equal 'recovery', token.action
@@ -57,7 +57,7 @@ class AccountTest < ActionController::IntegrationTest
assert_template "account/password_recovery"
post "account/lost_password", :token => token.value, :new_password => 'newpass', :new_password_confirmation => 'newpass'
- assert_redirected_to "account/login"
+ assert_redirected_to "/login"
assert_equal 'Password was successfully updated.', flash[:notice]
log_user('jsmith', 'newpass')
@@ -86,7 +86,7 @@ class AccountTest < ActionController::IntegrationTest
post 'account/register', :user => {:login => "newuser", :language => "en", :firstname => "New", :lastname => "User", :mail => "newuser@foo.bar"},
:password => "newpass", :password_confirmation => "newpass"
- assert_redirected_to 'account/login'
+ assert_redirected_to '/login'
assert !User.find_by_login('newuser').active?
end
@@ -96,7 +96,7 @@ class AccountTest < ActionController::IntegrationTest
post 'account/register', :user => {:login => "newuser", :language => "en", :firstname => "New", :lastname => "User", :mail => "newuser@foo.bar"},
:password => "newpass", :password_confirmation => "newpass"
- assert_redirected_to 'account/login'
+ assert_redirected_to '/login'
assert !User.find_by_login('newuser').active?
token = Token.find(:first)
@@ -105,7 +105,7 @@ class AccountTest < ActionController::IntegrationTest
assert !token.expired?
get 'account/activate', :token => token.value
- assert_redirected_to 'account/login'
+ assert_redirected_to '/login'
log_user('newuser', 'newpass')
end
@@ -139,7 +139,7 @@ class AccountTest < ActionController::IntegrationTest
assert_no_tag :input, :attributes => { :name => 'user[password]' }
post 'account/register', :user => {:firstname => 'Foo', :lastname => 'Smith', :mail => 'foo@bar.com'}
- assert_redirected_to 'my/account'
+ assert_redirected_to '/my/account'
user = User.find_by_login('foo')
assert user.is_a?(User)
diff --git a/test/integration/admin_test.rb b/test/integration/admin_test.rb
index 5182c9abd..6c1db7503 100644
--- a/test/integration/admin_test.rb
+++ b/test/integration/admin_test.rb
@@ -26,7 +26,7 @@ class AdminTest < ActionController::IntegrationTest
assert_response :success
assert_template "users/add"
post "/users/add", :user => { :login => "psmith", :firstname => "Paul", :lastname => "Smith", :mail => "psmith@somenet.foo", :language => "en" }, :password => "psmith09", :password_confirmation => "psmith09"
- assert_redirected_to "users/list"
+ assert_redirected_to "/users"
user = User.find_by_login("psmith")
assert_kind_of User, user
@@ -35,7 +35,7 @@ class AdminTest < ActionController::IntegrationTest
assert_equal "Paul", logged_user.firstname
post "users/edit", :id => user.id, :user => { :status => User::STATUS_LOCKED }
- assert_redirected_to "users/list"
+ assert_redirected_to "/users"
locked_user = User.try_to_login("psmith", "psmith09")
assert_equal nil, locked_user
end
diff --git a/test/integration/application_test.rb b/test/integration/application_test.rb
index 18f4891c2..dc6fdf392 100644
--- a/test/integration/application_test.rb
+++ b/test/integration/application_test.rb
@@ -18,6 +18,8 @@
require "#{File.dirname(__FILE__)}/../test_helper"
class ApplicationTest < ActionController::IntegrationTest
+ include Redmine::I18n
+
fixtures :users
def test_set_localization
@@ -27,13 +29,13 @@ class ApplicationTest < ActionController::IntegrationTest
get 'projects', { }, 'Accept-Language' => 'fr,fr-fr;q=0.8,en-us;q=0.5,en;q=0.3'
assert_response :success
assert_tag :tag => 'h2', :content => 'Projets'
- assert_equal 'fr', User.current.language
+ assert_equal :fr, current_language
# then an italien user
get 'projects', { }, 'Accept-Language' => 'it;q=0.8,en-us;q=0.5,en;q=0.3'
assert_response :success
assert_tag :tag => 'h2', :content => 'Progetti'
- assert_equal 'it', User.current.language
+ assert_equal :it, current_language
# not a supported language: default language should be used
get 'projects', { }, 'Accept-Language' => 'zz'
diff --git a/test/integration/issues_test.rb b/test/integration/issues_test.rb
index 61bbbce34..9f3c07f18 100644
--- a/test/integration/issues_test.rb
+++ b/test/integration/issues_test.rb
@@ -54,7 +54,7 @@ class IssuesTest < ActionController::IntegrationTest
assert_kind_of Issue, issue
# check redirection
- assert_redirected_to :controller => 'issues', :action => 'show'
+ assert_redirected_to :controller => 'issues', :action => 'show', :id => issue
follow_redirect!
assert_equal issue, assigns(:issue)