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:
- 2053 Bytes
1 | require File.dirname(__FILE__) + '/../../test_helper' |
2 | require 'admin/content_controller' |
3 | require 'http_mock' |
4 | require 'base64' |
5 | |
6 | class Admin::ContentController; def rescue_action(e) raise e end; end |
7 | |
8 | class Admin::ArticlePreviewTest < Test::Unit::TestCase |
9 | fixtures :contents, :users, :categories, :resources, :text_filters, :blogs |
10 | |
11 | def setup |
12 | @controller = Admin::ContentController.new |
13 | @request = ActionController::TestRequest.new |
14 | @response = ActionController::TestResponse.new |
15 | @request.session = {:user => users(:tobi)} |
16 | |
17 | @art_count = Article.find(:all).size |
18 | end |
19 | |
20 | def assert_no_new_articles |
21 | assert_equal @art_count, Article.find(:all).size |
22 | end |
23 | |
24 | DATA_URI_HEADER = "data:text/html;charset=utf-8;base64," |
25 | def extract_data_uri |
26 | assert_equal DATA_URI_HEADER, @response.body[0,DATA_URI_HEADER.size] |
27 | data = @response.body[DATA_URI_HEADER.size..-1] |
28 | data = Base64.decode64(data) |
29 | @response.body = data |
30 | end |
31 | |
32 | def test_only_title |
33 | post :preview, 'article' => { :title => 'A title' } |
34 | assert_response :success |
35 | assert_template 'preview' |
36 | extract_data_uri |
37 | assert_tag :tag => 'h2', :content => 'A title' |
38 | assert_no_new_articles |
39 | end |
40 | |
41 | def test_only_body |
42 | post :preview, :article => { :body => 'A body' } |
43 | |
44 | extract_data_uri |
45 | |
46 | assert_tag :tag => 'p', |
47 | :child => 'A body', |
48 | :after => { :tag => 'h2', :content => "" } |
49 | |
50 | assert_no_new_articles |
51 | end |
52 | |
53 | def test_only_extended |
54 | post :preview, :article => { :body => 'An extension' } |
55 | |
56 | extract_data_uri |
57 | |
58 | assert_tag :tag => 'p', |
59 | :child => 'An extension', |
60 | :after => { :tag => 'h2', :content => "" } |
61 | |
62 | assert_no_new_articles |
63 | end |
64 | |
65 | def test_full_post |
66 | post :preview, :article => { |
67 | :title => 'A title', :body => 'A body', |
68 | :extended => 'An extension' } |
69 | |
70 | extract_data_uri |
71 | |
72 | assert_tag \ |
73 | :tag => 'p', |
74 | :child => 'An extension', |
75 | :after => {:tag => 'p', :child => 'A body', |
76 | :after => { :tag => 'h2', :content => "A title" }} |
77 | |
78 | assert_no_new_articles |
79 | end |
80 | |
81 | |
82 | end |