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:
- 1553 Bytes
1 | require File.dirname(__FILE__) + '/../test_helper' |
2 | |
3 | class ProjectTest < Test::Unit::TestCase |
4 | fixtures :projects, :users, :assets |
5 | |
6 | def test_create_project |
7 | assert create_project.valid? |
8 | end |
9 | |
10 | def test_should_require_name |
11 | p = create_project(:name => nil) |
12 | assert p.errors.on(:name) |
13 | end |
14 | |
15 | def test_should_require_user_id |
16 | p = create_project(:user_id => nil) |
17 | assert p.errors.on(:user_id) |
18 | end |
19 | |
20 | def test_should_show_only_visible_assets |
21 | p = Project.find 1 |
22 | assert_equal 5, p.assets.length |
23 | assert_equal 3, p.visible_assets.length |
24 | # TODO assert_equal [assets(:person_drinking), assets(:can_label), assets(:closeup)], p.visible_assets |
25 | end |
26 | |
27 | # BUG: Not working...slips through with no errors |
28 | # def test_should_reject_non_existent_user |
29 | # p = create_project(:user_id => 42) |
30 | # assert p.errors.on(:user_id) |
31 | # end |
32 | |
33 | |
34 | # |
35 | # def test_should_reset_password |
36 | # users(:quentin).update_attributes(:password => 'new password', :password_confirmation => 'new password') |
37 | # assert_equal users(:quentin), User.authenticate('quentin', 'new password') |
38 | # end |
39 | # |
40 | # def test_should_not_rehash_password |
41 | # users(:quentin).update_attributes(:login => 'quentin2') |
42 | # assert_equal users(:quentin), User.authenticate('quentin2', 'quentin') |
43 | # end |
44 | # |
45 | # def test_should_authenticate_user |
46 | # assert_equal users(:quentin), User.authenticate('quentin', 'quentin') |
47 | # end |
48 | |
49 | protected |
50 | |
51 | def create_project(options = {}) |
52 | Project.create({ :name => 'Cloneberry Cobbler', :user_id => 1 }.merge(options)) |
53 | end |
54 | |
55 | end |