Changesets can be listed by changeset number.
The Git repository is here.
- Revision:
- 193
- Log:
First stage commit of Typo 4.1, modified for the ROOL site.
Includes all local modifications but a final pass needs to be
made to delete any files left over from earlier Typo versions
that shouldn't be here anymore. See the 'tags' section of the
repository for a clean Typo 4.1 tree.Note that symlinks to shared files in the RISC OS Open theme
directory have been deliberately included this time around; I
decided that on balance it was better to leave them in as
placeholders, since unlike symlinks in app/views/shared, the
Typo theme structure is not a standard Rails concept.
- Author:
- rool
- Date:
- Wed Apr 04 18:51:02 +0100 2007
- Size:
- 2389 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 | assert @response.redirect_url_match?("http://localhost/bogus/location") |
28 | end |
29 | |
30 | def test_signup |
31 | User.destroy_all # Need to trick AccountController#signup into thinking this is a brand new blog |
32 | post :signup, :user => { :login => "newbob", :password => "newpassword", :password_confirmation => "newpassword" } |
33 | assert_session_has :user |
34 | |
35 | assert_response :redirect, :controller => "admin/general", :action => "index" |
36 | end |
37 | |
38 | def test_disable_signup_after_user_exists |
39 | get :signup |
40 | assert_response :redirect, :action => "login" |
41 | end |
42 | |
43 | def test_bad_signup |
44 | @request.session[:return_to] = "/bogus/location" |
45 | |
46 | User.delete_all |
47 | |
48 | post :signup, :user => { :login => "newbob", :password => "newpassword", :password_confirmation => "wrong" } |
49 | assert_invalid_column_on_record "user", :password |
50 | assert_response :success |
51 | |
52 | post :signup, :user => { :login => "yo", :password => "newpassword", :password_confirmation => "newpassword" } |
53 | assert_invalid_column_on_record "user", :login |
54 | assert_response :success |
55 | |
56 | post :signup, :user => { :login => "yo", :password => "newpassword", :password_confirmation => "wrong" } |
57 | assert_invalid_column_on_record "user", [:login, :password] |
58 | assert_response :success |
59 | end |
60 | |
61 | def test_invalid_login |
62 | post :login, :user_login => "bob", :user_password => "not_correct" |
63 | |
64 | assert_session_has_no :user |
65 | |
66 | assert_template_has "login" |
67 | end |
68 | |
69 | def test_login_logoff |
70 | |
71 | post :login, :user_login => "bob", :user_password => "test" |
72 | assert_session_has :user |
73 | |
74 | get :logout |
75 | assert_session_has_no :user |
76 | |
77 | end |
78 | end |