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
b135162c
Commit
b135162c
authored
Jul 02, 2011
by
Tom Rochette
Committed by
Holger Just
Dec 18, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Login should redirect to welcome/home page if already logged in.
parent
bde0f6a8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
3 deletions
+14
-3
account_controller.rb
app/controllers/account_controller.rb
+3
-3
account_controller_test.rb
test/functional/account_controller_test.rb
+11
-0
No files found.
app/controllers/account_controller.rb
View file @
b135162c
...
@@ -20,9 +20,9 @@ class AccountController < ApplicationController
...
@@ -20,9 +20,9 @@ class AccountController < ApplicationController
# Login request and validation
# Login request and validation
def
login
def
login
if
request
.
get
?
if
User
.
current
.
logged
?
logout_user
redirect_to
home_url
els
e
els
if
request
.
post?
authenticate_user
authenticate_user
end
end
end
end
...
...
test/functional/account_controller_test.rb
View file @
b135162c
...
@@ -47,6 +47,17 @@ class AccountControllerTest < ActionController::TestCase
...
@@ -47,6 +47,17 @@ class AccountControllerTest < ActionController::TestCase
:content
=>
/Invalid user or password/
:content
=>
/Invalid user or password/
end
end
def
test_login
get
:login
assert_template
'login'
end
def
test_login_with_logged_account
@request
.
session
[
:user_id
]
=
2
get
:login
assert_redirected_to
home_url
end
if
Object
.
const_defined?
(
:OpenID
)
if
Object
.
const_defined?
(
:OpenID
)
def
test_login_with_openid_for_existing_user
def
test_login_with_openid_for_existing_user
...
...
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