Changesets can be listed by changeset number.
The Git repository is here.
- Revision:
- 13
- Log:
Initial import of Typo 2.6.0 sources from a downloaded Tarball.
Typo is a Ruby On Rails based blog engine.
- Author:
- adh
- Date:
- Sat Jul 22 22:25:02 +0100 2006
- Size:
- 1606 Bytes
1 | require File.dirname(__FILE__) + '/../../test_helper' |
2 | require 'admin/categories_controller' |
3 | |
4 | # Re-raise errors caught by the controller. |
5 | class Admin::CategoriesController; def rescue_action(e) raise e end; end |
6 | |
7 | class Admin::CategoriesControllerTest < Test::Unit::TestCase |
8 | fixtures :categories, :users |
9 | |
10 | def setup |
11 | @controller = Admin::CategoriesController.new |
12 | @request = ActionController::TestRequest.new |
13 | @response = ActionController::TestResponse.new |
14 | |
15 | @request.session = { :user => @tobi } |
16 | end |
17 | |
18 | def test_index |
19 | get :index |
20 | assert_rendered_file 'list' |
21 | end |
22 | |
23 | def test_list |
24 | get :list |
25 | assert_rendered_file 'list' |
26 | assert_template_has 'categories' |
27 | end |
28 | |
29 | def test_show |
30 | get :show, 'id' => 1 |
31 | assert_rendered_file 'show' |
32 | assert_template_has 'category' |
33 | assert_valid_record 'category' |
34 | end |
35 | |
36 | def test_create |
37 | num_categories = Category.find_all.size |
38 | |
39 | post :new, 'category' => { :name => "test category" } |
40 | assert_redirected_to :action => 'list' |
41 | |
42 | assert_equal num_categories + 1, Category.find_all.size |
43 | end |
44 | |
45 | def test_edit |
46 | get :edit, 'id' => 1 |
47 | assert_rendered_file 'edit' |
48 | assert_template_has 'category' |
49 | assert_valid_record 'category' |
50 | end |
51 | |
52 | def test_update |
53 | post :edit, 'id' => 1 |
54 | assert_redirected_to :action => 'list' |
55 | end |
56 | |
57 | def test_destroy |
58 | assert_not_nil Category.find(1) |
59 | |
60 | get :destroy, 'id' => 1 |
61 | assert_success |
62 | |
63 | post :destroy, 'id' => 1 |
64 | assert_redirected_to :action => 'list' |
65 | |
66 | assert_raise(ActiveRecord::RecordNotFound) { |
67 | category = Category.find(1) |
68 | } |
69 | end |
70 | end |