Changesets can be listed by changeset number.
The Git repository is here.
- Revision:
- 15
- Log:
Attempt to update Typo to a Typo SVN HEAD release from around the
time the prototype installation was set up on the RISC OS Open Limited
web site. Timestamps place this at 04-Jul so a revision from 05-Jul or
earlier was pulled and copied over the 2.6.0 tarball stable code.
- Author:
- adh
- Date:
- Sat Jul 22 23:27:35 +0100 2006
- Size:
- 2371 Bytes
1 | require File.dirname(__FILE__) + '/../test_helper' |
2 | require 'accounts_controller' |
3 | |
4 | # Set salt to 'change-me' because thats what the fixtures assume. |
5 | User.salt = 'change-me' |
6 | |
7 | # Raise errors beyond the default web-based presentation |
8 | class AccountsController; def rescue_action(e) raise e end; end |
9 | |
10 | class AccountsControllerTest < Test::Unit::TestCase |
11 | |
12 | fixtures :users, :blogs |
13 | |
14 | def setup |
15 | @controller = AccountsController.new |
16 | @request, @response = ActionController::TestRequest.new, ActionController::TestResponse.new |
17 | @request.host = "localhost" |
18 | end |
19 | |
20 | def test_auth_bob |
21 | @request.session[:return_to] = "/bogus/location" |
22 | |
23 | post :login, :user_login => "bob", :user_password => "test" |
24 | assert_session_has :user |
25 | |
26 | assert_equal users(:bob), @response.session[:user] |
27 | |
28 | assert_redirect_url "http://localhost/bogus/location" |
29 | end |
30 | |
31 | def test_signup |
32 | User.destroy_all # Need to trick AccountController#signup into thinking this is a brand new blog |
33 | post :signup, :user => { :login => "newbob", :password => "newpassword", :password_confirmation => "newpassword" } |
34 | assert_session_has :user |
35 | |
36 | assert_redirect |
37 | assert_redirected_to :controller => "admin/general", :action => "index" |
38 | end |
39 | |
40 | def test_disable_signup_after_user_exists |
41 | get :signup |
42 | assert_redirect |
43 | assert_redirected_to :action => "login" |
44 | end |
45 | |
46 | def test_bad_signup |
47 | @request.session[:return_to] = "/bogus/location" |
48 | |
49 | User.delete_all |
50 | |
51 | post :signup, :user => { :login => "newbob", :password => "newpassword", :password_confirmation => "wrong" } |
52 | assert_invalid_column_on_record "user", :password |
53 | assert_success |
54 | |
55 | post :signup, :user => { :login => "yo", :password => "newpassword", :password_confirmation => "newpassword" } |
56 | assert_invalid_column_on_record "user", :login |
57 | assert_success |
58 | |
59 | post :signup, :user => { :login => "yo", :password => "newpassword", :password_confirmation => "wrong" } |
60 | assert_invalid_column_on_record "user", [:login, :password] |
61 | assert_success |
62 | end |
63 | |
64 | def test_invalid_login |
65 | post :login, :user_login => "bob", :user_password => "not_correct" |
66 | |
67 | assert_session_has_no :user |
68 | |
69 | assert_template_has "login" |
70 | end |
71 | |
72 | def test_login_logoff |
73 | |
74 | post :login, :user_login => "bob", :user_password => "test" |
75 | assert_session_has :user |
76 | |
77 | get :logout |
78 | assert_session_has_no :user |
79 | |
80 | end |
81 | |
82 | end |