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:
- 3026 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 => users(:tobi) } |
16 | end |
17 | |
18 | def test_index |
19 | get :index |
20 | assert_template 'list' |
21 | assert_template_has 'categories' |
22 | end |
23 | |
24 | def test_list |
25 | get :list |
26 | assert_template 'list' |
27 | assert_template_has 'categories' |
28 | assert_tag :tag => "div", |
29 | :attributes => { :id => "category_container" } |
30 | end |
31 | |
32 | def test_show |
33 | get :show, 'id' => 1 |
34 | assert_template 'show' |
35 | assert_template_has 'category' |
36 | assert_valid assigns(:category) |
37 | end |
38 | |
39 | def test_create |
40 | num_categories = Category.count |
41 | |
42 | post :new, 'category' => { :name => "test category" } |
43 | assert_response :redirect, :action => 'list' |
44 | |
45 | assert_equal num_categories + 1, Category.count |
46 | end |
47 | |
48 | def test_edit |
49 | get :edit, :id => 1 |
50 | assert_template 'edit' |
51 | assert_template_has 'category' |
52 | assert_valid assigns(:category) |
53 | end |
54 | |
55 | def test_update |
56 | post :edit, :id => 1 |
57 | assert_response :redirect, :action => 'list' |
58 | end |
59 | |
60 | def test_destroy |
61 | assert_not_nil Category.find(1) |
62 | |
63 | get :destroy, :id => 1 |
64 | assert_response :success |
65 | assert_template 'destroy' |
66 | |
67 | post :destroy, :id => 1 |
68 | assert_response :redirect, :action => 'list' |
69 | |
70 | assert_raise(ActiveRecord::RecordNotFound) { Category.find(1) } |
71 | end |
72 | |
73 | def test_order |
74 | assert_equal categories(:software), Category.find(:first, :order => :position) |
75 | get :order, :category_list => [categories(:personal).id, categories(:hardware).id, categories(:software).id] |
76 | assert_response :success |
77 | assert_equal categories(:personal), Category.find(:first, :order => :position) |
78 | end |
79 | |
80 | def test_asort |
81 | assert_equal categories(:software), Category.find(:first, :order => :position) |
82 | get :asort |
83 | assert_response :success |
84 | assert_template "_categories" |
85 | assert_equal categories(:hardware), Category.find(:first, :order => :position) |
86 | end |
87 | |
88 | def test_category_container |
89 | get :category_container |
90 | assert_response :success |
91 | assert_template "_categories" |
92 | assert_tag :tag => "table", |
93 | :children => { :count => Category.count + 1, |
94 | :only => { :tag => "tr", |
95 | :children => { :count => 3, |
96 | :only => { :tag => /t[dh]/ } } } } |
97 | end |
98 | |
99 | def test_reorder |
100 | get :reorder |
101 | assert_response :success |
102 | assert_template "reorder" |
103 | assert_tag :tag => "ul", |
104 | :attributes => { :id => "category_list" }, |
105 | :children => { :count => Category.count, |
106 | :only => { :tag => "li", |
107 | :attributes => { :id => /category_\d+/ } } } |
108 | |
109 | assert_tag :tag => "a", |
110 | :content => "(Done)" |
111 | end |
112 | end |