Changesets can be listed by changeset number.
The Git repository is here.
- Revision:
- 24
- Log:
Initial import of Collaboa 0.5.6 from downloaded Tarball. Collaboa is
a Ruby On Rails based bug tracker and SVN repository browsing tool.
- Author:
- adh
- Date:
- Mon Jul 24 21:54:39 +0100 2006
- Size:
- 2655 Bytes
1 | require File.dirname(__FILE__) + '/../test_helper' |
2 | |
3 | class UserTest < Test::Unit::TestCase |
4 | |
5 | fixtures :users |
6 | |
7 | def test_auth |
8 | |
9 | assert_equal users(:bob), User.authenticate("bob", "test") |
10 | assert_nil User.authenticate("nonbob", "test") |
11 | |
12 | end |
13 | |
14 | |
15 | def test_passwordchange |
16 | |
17 | users(:longbob).change_password("nonbobpasswd") |
18 | assert_equal users(:longbob), User.authenticate("longbob", "nonbobpasswd") |
19 | assert_nil User.authenticate("longbob", "longtest") |
20 | users(:longbob).change_password("longtest") |
21 | assert_equal users(:longbob), User.authenticate("longbob", "longtest") |
22 | assert_nil User.authenticate("longbob", "nonbobpasswd") |
23 | |
24 | end |
25 | |
26 | def test_disallowed_passwords |
27 | |
28 | u = User.new |
29 | u.login = "nonbob" |
30 | |
31 | u.password = u.password_confirmation = "tiny" |
32 | assert !u.save |
33 | assert u.errors.invalid?('password') |
34 | |
35 | u.password = u.password_confirmation = "hugehugehugehugehugehugehugehugehugehugehugehugehugehugehugehugehugehugehugehugehugehugehugehugehugehugehugehugehugehugehugehugehugehugehugehugehugehugehugehugehugehugehuge" |
36 | assert !u.save |
37 | assert u.errors.invalid?('password') |
38 | |
39 | u.password = u.password_confirmation = "" |
40 | assert !u.save |
41 | assert u.errors.invalid?('password') |
42 | |
43 | u.password = u.password_confirmation = "bobs_secure_password" |
44 | assert u.save |
45 | assert u.errors.empty? |
46 | |
47 | end |
48 | |
49 | def test_bad_logins |
50 | |
51 | u = User.new |
52 | u.password = u.password_confirmation = "bobs_secure_password" |
53 | |
54 | u.login = "x" |
55 | assert !u.save |
56 | assert u.errors.invalid?('login') |
57 | |
58 | u.login = "hugebobhugebobhugebobhugebobhugebobhugebobhugebobhugebobhugebobhugebobhugebobhugebobhugebobhugebobhugebobhugebobhugebobhugebobhugebobhugebobhugebobhugebobhugebobhugebobhugebobhugebobhug" |
59 | assert !u.save |
60 | assert u.errors.invalid?('login') |
61 | |
62 | u.login = "" |
63 | assert !u.save |
64 | assert u.errors.invalid?('login') |
65 | |
66 | u.login = "okbob" |
67 | assert u.save |
68 | assert u.errors.empty? |
69 | |
70 | end |
71 | |
72 | |
73 | def test_collision |
74 | u = User.new |
75 | u.login = "existingbob" |
76 | u.password = u.password_confirmation = "bobs_secure_password" |
77 | assert !u.save |
78 | end |
79 | |
80 | |
81 | def test_create |
82 | u = User.new |
83 | u.login = "nonexistingbob" |
84 | u.password = u.password_confirmation = "bobs_secure_password" |
85 | |
86 | assert u.save |
87 | |
88 | end |
89 | |
90 | def test_sha1 |
91 | u = User.new |
92 | u.login = "nonexistingbob" |
93 | u.password = u.password_confirmation = "bobs_secure_password" |
94 | assert u.save |
95 | |
96 | assert_equal 'e5e7395b3f57d65e8ef03cfa5048f2739ebc747f', u.password |
97 | |
98 | end |
99 | |
100 | |
101 | end |