Changesets can be listed by changeset number.
The Git repository is here.
- Revision:
- 15
- Log:
Attempt to update Typo to a Typo SVN HEAD release from around the
time the prototype installation was set up on the RISC OS Open Limited
web site. Timestamps place this at 04-Jul so a revision from 05-Jul or
earlier was pulled and copied over the 2.6.0 tarball stable code.
- Author:
- adh
- Date:
- Sat Jul 22 23:27:35 +0100 2006
- Size:
- 1896 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, :users |
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_rendered_file 'list' |
22 | end |
23 | |
24 | def test_list |
25 | get :list, :article_id => 2 |
26 | assert_rendered_file 'list' |
27 | assert_template_has 'comments' |
28 | end |
29 | |
30 | def test_show |
31 | get :show, :id => 5, :article_id => 2 |
32 | assert_rendered_file 'show' |
33 | assert_template_has 'comment' |
34 | assert_valid_record 'comment' |
35 | end |
36 | |
37 | def test_new |
38 | get :new, :article_id => 2 |
39 | assert_rendered_file 'new' |
40 | assert_template_has 'comment' |
41 | end |
42 | |
43 | def test_create |
44 | num_comments = Comment.find_all.size |
45 | |
46 | post(:new, :comment => { 'author' => 'author', 'body' => 'body' }, |
47 | :article_id => 2) |
48 | assert_redirected_to :action => 'show' |
49 | |
50 | assert_equal num_comments + 1, Comment.find_all.size |
51 | end |
52 | |
53 | def test_edit |
54 | get :edit, :id => 5, :article_id => 2 |
55 | assert_rendered_file 'edit' |
56 | assert_template_has 'comment' |
57 | assert_valid_record 'comment' |
58 | end |
59 | |
60 | def test_update |
61 | post :edit, :id => 5, :article_id => 2 |
62 | assert_redirected_to :action => 'show', :id => 5 |
63 | end |
64 | |
65 | def test_destroy |
66 | assert_not_nil Comment.find(5) |
67 | |
68 | get :destroy, :id => 5, :article_id => 2 |
69 | assert_success |
70 | |
71 | post :destroy, :id => 5, :article_id => 2 |
72 | assert_redirected_to :action => 'list' |
73 | |
74 | assert_raise(ActiveRecord::RecordNotFound) { |
75 | comment = Comment.find(5) |
76 | } |
77 | end |
78 | end |