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:
- 2129 Bytes
1 | require File.dirname(__FILE__) + '/../../test_helper' |
2 | require 'admin/trackbacks_controller' |
3 | |
4 | # Re-raise errors caught by the controller. |
5 | class Admin::TrackbacksController; def rescue_action(e) raise e end; end |
6 | |
7 | class Admin::TrackbacksControllerTest < Test::Unit::TestCase |
8 | fixtures :contents, :feedback, :users |
9 | |
10 | def setup |
11 | @controller = Admin::TrackbacksController.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, :article_id => 2 |
20 | assert_template 'list' |
21 | end |
22 | |
23 | def test_list |
24 | get :list, :article_id => 2 |
25 | assert_template 'list' |
26 | assert_template_has 'trackbacks' |
27 | end |
28 | |
29 | def test_show |
30 | get :show, :id => feedback(:trackback1).id, :article_id => 2 |
31 | assert_template 'show' |
32 | assert_template_has 'trackback' |
33 | assert_valid assigns(:trackback) |
34 | end |
35 | |
36 | def test_new |
37 | get :new, :article_id => 2 |
38 | assert_template 'new' |
39 | assert_template_has 'trackback' |
40 | end |
41 | |
42 | def test_create |
43 | num_trackbacks = Trackback.count |
44 | |
45 | post :new, :trackback => { 'title' => 'title', 'excerpt' => 'excerpt', 'blog_name' => 'blog_name', 'url' => 'url' }, :article_id => 2 |
46 | assert_response :redirect, :action => 'show' |
47 | |
48 | assert_equal num_trackbacks + 1, Trackback.count |
49 | end |
50 | |
51 | def test_edit |
52 | get :edit, :id => feedback(:trackback1).id, :article_id => 2 |
53 | assert_template 'edit' |
54 | assert_template_has 'trackback' |
55 | assert_valid assigns(:trackback) |
56 | end |
57 | |
58 | def test_update |
59 | post :edit, :id => feedback(:trackback1).id, :article_id => 2 |
60 | assert_response :redirect, :action => 'show', :id => feedback(:trackback1).id |
61 | end |
62 | |
63 | def test_destroy |
64 | assert_not_nil Trackback.find(feedback(:trackback1).id) |
65 | |
66 | get :destroy, :id => feedback(:trackback1).id, :article_id => 2 |
67 | assert_response :success |
68 | |
69 | post :destroy, :id => feedback(:trackback1).id, :article_id => 2 |
70 | assert_response :redirect, :action => 'list' |
71 | |
72 | assert_raise(ActiveRecord::RecordNotFound) { |
73 | trackback = Trackback.find(feedback(:trackback1).id) |
74 | } |
75 | end |
76 | end |