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:
- 2132 Bytes
1 | require File.dirname(__FILE__) + '/../../test_helper' |
2 | require 'admin/comments_controller' |
3 | require 'dns_mock' |
4 | |
5 | # Re-raise errors caught by the controller. |
6 | class Admin::CommentsController; def rescue_action(e) raise e end; end |
7 | |
8 | class Admin::CommentsControllerTest < Test::Unit::TestCase |
9 | fixtures :contents, :feedback, :users, :notifications |
10 | |
11 | def setup |
12 | @controller = Admin::CommentsController.new |
13 | @request = ActionController::TestRequest.new |
14 | @response = ActionController::TestResponse.new |
15 | |
16 | @request.session = { :user => users(:tobi) } |
17 | end |
18 | |
19 | def test_index |
20 | get :index, :article_id => 2 |
21 | assert_template 'list' |
22 | end |
23 | |
24 | def test_list |
25 | get :list, :article_id => 2 |
26 | assert_template 'list' |
27 | assert_template_has 'comments' |
28 | end |
29 | |
30 | def test_show |
31 | get :show, :id => feedback(:spam_comment).id, :article_id => 2 |
32 | assert_template 'show' |
33 | assert_template_has 'comment' |
34 | assert_valid @response.template_objects['comment'] |
35 | end |
36 | |
37 | def test_new |
38 | get :new, :article_id => 2 |
39 | assert_template 'new' |
40 | assert_template_has 'comment' |
41 | end |
42 | |
43 | def test_create |
44 | num_comments = Comment.count |
45 | |
46 | post(:new, :comment => { 'author' => 'author', 'body' => 'body' }, |
47 | :article_id => 2) |
48 | assert_response :redirect, :action => 'show' |
49 | |
50 | assert_equal num_comments + 1, Comment.count |
51 | end |
52 | |
53 | def test_edit |
54 | get :edit, :id => feedback(:spam_comment).id, :article_id => 2 |
55 | assert_template 'edit' |
56 | assert_template_has 'comment' |
57 | assert_valid assigns(:comment) |
58 | end |
59 | |
60 | def test_update |
61 | post :edit, :id => feedback(:spam_comment).id, :article_id => 2 |
62 | assert_response :redirect, :action => 'show', :id => feedback(:spam_comment).id |
63 | end |
64 | |
65 | def test_destroy |
66 | assert_not_nil Comment.find(feedback(:spam_comment).id) |
67 | |
68 | get :destroy, :id => feedback(:spam_comment).id, :article_id => 2 |
69 | assert_response :success |
70 | |
71 | post :destroy, :id => feedback(:spam_comment).id, :article_id => 2 |
72 | assert_response :redirect, :action => 'list' |
73 | |
74 | assert_raise(ActiveRecord::RecordNotFound) { |
75 | comment = Comment.find(feedback(:spam_comment).id) |
76 | } |
77 | end |
78 | end |