Changesets can be listed by changeset number.
The Git repository is here.
- Revision:
- 206
- Log:
Initial import of Gullery, an open source photo gallery:
http://nubyonrails.com/pages/gullery
- Author:
- rool
- Date:
- Sun May 20 19:05:59 +0100 2007
- Size:
- 1295 Bytes
1 | require File.dirname(__FILE__) + '/../test_helper' |
2 | |
3 | class UserTest < Test::Unit::TestCase |
4 | fixtures :users |
5 | |
6 | def test_should_create_user |
7 | assert create_user.valid? |
8 | end |
9 | |
10 | def test_should_require_login |
11 | u = create_user(:login => nil) |
12 | assert u.errors.on(:login) |
13 | end |
14 | |
15 | def test_should_require_password |
16 | u = create_user(:password => nil) |
17 | assert u.errors.on(:password) |
18 | end |
19 | |
20 | def test_should_require_password_confirmation |
21 | u = create_user(:password_confirmation => nil) |
22 | assert u.errors.on(:password_confirmation) |
23 | end |
24 | |
25 | def test_should_reset_password |
26 | users(:quentin).update_attributes(:password => 'new password', :password_confirmation => 'new password') |
27 | assert_equal users(:quentin), User.authenticate('quentin', 'new password') |
28 | end |
29 | |
30 | def test_should_not_rehash_password |
31 | users(:quentin).update_attributes(:login => 'quentin2') |
32 | assert_equal users(:quentin), User.authenticate('quentin2', 'quentin') |
33 | end |
34 | |
35 | def test_should_authenticate_user |
36 | assert_equal users(:quentin), User.authenticate('quentin', 'quentin') |
37 | end |
38 | |
39 | protected |
40 | def create_user(options = {}) |
41 | User.create({ :name => 'Quire Johnson', :login => 'quire', :email => 'quire@example.com', :password => 'quire', :password_confirmation => 'quire' }.merge(options)) |
42 | end |
43 | end |