mirror of
https://github.com/TracksApp/tracks.git
synced 2026-02-25 08:34:08 +01:00
Introduce current_user and prefs accessors that replace the @user and @prefs variables that were being used in most places.
git-svn-id: http://www.rousette.org.uk/svn/tracks-repos/trunk@575 a4c988fc-2ded-0310-b66e-134b36920a42
This commit is contained in:
parent
ad5fbc7147
commit
30c23fc560
18 changed files with 233 additions and 207 deletions
|
|
@ -114,6 +114,26 @@ class LoginControllerTest < Test::Rails::TestCase
|
|||
assert !@controller.send(:logged_in?)
|
||||
end
|
||||
|
||||
def test_current_user_nil
|
||||
get :login
|
||||
assert_nil @controller.current_user
|
||||
end
|
||||
|
||||
def test_current_user_correct
|
||||
user = login('jane','sesame', 'off')
|
||||
assert_equal user, @controller.current_user
|
||||
end
|
||||
|
||||
def test_prefs_nil
|
||||
get :login
|
||||
assert_nil @controller.prefs
|
||||
end
|
||||
|
||||
def test_prefs_correct
|
||||
user = login('jane','sesame', 'off')
|
||||
assert_equal user.prefs, @controller.prefs
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
# Logs in a user and returns the user object found in the session object
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue