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:
- 3744 Bytes
1 | require File.dirname(__FILE__) + '/../test_helper' |
2 | |
3 | require 'flickr_mock' |
4 | |
5 | class TextFilterTest < Test::Unit::TestCase |
6 | fixtures :text_filters |
7 | |
8 | def setup |
9 | @text_filter = TextFilter.find(1) |
10 | end |
11 | |
12 | # Replace this with your real tests. |
13 | def test_truth |
14 | assert_kind_of TextFilter, @text_filter |
15 | end |
16 | |
17 | def test_markdownsmartypants_fixture |
18 | ms = TextFilter.find_by_name('markdown smartypants') |
19 | |
20 | assert_equal text_filters(:markdownsmartypants_filter), ms |
21 | assert_equal 'markdown', ms.markup |
22 | assert_equal [:smartypants], ms.filters |
23 | assert_equal Hash.new, ms.params |
24 | end |
25 | |
26 | def test_textile_fixture |
27 | tx = TextFilter.find_by_name('textile') |
28 | assert_equal text_filters(:textile_filter), tx |
29 | assert_equal 'textile', tx.markup |
30 | assert_equal [], tx.filters |
31 | end |
32 | |
33 | def test_available |
34 | filters = TextFilter.available_filters |
35 | |
36 | assert filters.include?(Typo::Textfilter::Markdown) |
37 | assert filters.include?(Typo::Textfilter::Smartypants) |
38 | assert filters.include?(Typo::Textfilter::Htmlfilter) |
39 | assert filters.include?(Typo::Textfilter::Textile) |
40 | assert filters.include?(Typo::Textfilter::Amazon) |
41 | assert filters.include?(Typo::Textfilter::Flickr) |
42 | |
43 | assert !filters.include?(TextFilterPlugin::Markup) |
44 | assert !filters.include?(TextFilterPlugin::Macro) |
45 | assert !filters.include?(TextFilterPlugin::PostProcess) |
46 | end |
47 | |
48 | def test_descriptions |
49 | TextFilter.available_filters.each do |filter| |
50 | assert filter.display_name.to_s.size > 0, "Blank display name for #{filter}" |
51 | assert filter.description.to_s.size > 0, "Blank description for #{filter}" |
52 | assert_not_equal 'Unknown Text Filter ',filter.display_name |
53 | assert_not_equal 'Unknown Text Filter Description',filter.description |
54 | end |
55 | end |
56 | |
57 | def test_filtertypes |
58 | types = TextFilter.available_filter_types |
59 | |
60 | assert_kind_of Hash, types |
61 | |
62 | assert types['markup'] |
63 | assert types['macropre'] |
64 | assert types['macropost'] |
65 | assert types['postprocess'] |
66 | assert types['other'] |
67 | |
68 | assert types['markup'].include?(Typo::Textfilter::Markdown) |
69 | assert types['markup'].include?(Typo::Textfilter::Textile) |
70 | |
71 | assert types['macropost'].include?(Typo::Textfilter::Flickr) |
72 | |
73 | assert types['macropre'].include?(Typo::Textfilter::Code) |
74 | |
75 | assert types['postprocess'].include?(Typo::Textfilter::Smartypants) |
76 | assert types['postprocess'].include?(Typo::Textfilter::Amazon) |
77 | |
78 | assert types['other'].include?(Typo::Textfilter::Htmlfilter) |
79 | assert types['other'].include?(Typo::Textfilter::MacroPre) |
80 | assert types['other'].include?(Typo::Textfilter::MacroPost) |
81 | |
82 | # There shouldn't be any 'other' plugins coming from users; they |
83 | # should all be part of the core |
84 | assert_equal 3, types['other'].size |
85 | end |
86 | |
87 | def test_map |
88 | map = TextFilter.filters_map |
89 | |
90 | assert_equal Typo::Textfilter::Markdown, |
91 | map['markdown'] |
92 | assert_equal Typo::Textfilter::Smartypants, |
93 | map['smartypants'] |
94 | assert_equal Typo::Textfilter::Htmlfilter, |
95 | map['htmlfilter'] |
96 | assert_equal Typo::Textfilter::Textile, |
97 | map['textile'] |
98 | assert_equal Typo::Textfilter::Amazon, |
99 | map['amazon'] |
100 | assert_equal Typo::Textfilter::Flickr, |
101 | map['flickr'] |
102 | end |
103 | |
104 | def test_help |
105 | filter = TextFilter.find_by_name('markdown') |
106 | help = filter.help.to_s |
107 | |
108 | assert help |
109 | assert help.size > 100 |
110 | assert help =~ /Flickr/ |
111 | assert help =~ /Markdown/ |
112 | assert help =~ /daringfireball/ |
113 | assert help =~ /<em>/ |
114 | end |
115 | |
116 | def test_commenthelp |
117 | filter = TextFilter.find_by_name('markdown') |
118 | help = filter.commenthelp.to_s |
119 | |
120 | assert help |
121 | assert help.size>100 |
122 | assert help !~ /Flickr/ |
123 | assert help !~ /<h.>/ |
124 | assert help =~ /<em>/ |
125 | end |
126 | end |