Changesets can be listed by changeset number.
The Git repository is here.
- Revision:
- 7
- Log:
Initial import of RForum 0.2 sources from a downloaded Tarball.
RForum is a Ruby On Rails based forum and mail gateway service.
- Author:
- adh
- Date:
- Sat Jul 22 18:43:13 +0100 2006
- Size:
- 1308 Bytes
1 | require 'test/unit' |
2 | require 'cgi' |
3 | require File.dirname(__FILE__) + '/../test_helper' |
4 | |
5 | class TestForumHelper < Test::Unit::TestCase |
6 | include ForumHelper |
7 | |
8 | def make_strings(url) |
9 | [ |
10 | "#{url}", |
11 | "#{url} ", |
12 | "#{url}\n", |
13 | "#{url}.", |
14 | "#{url})", |
15 | "#{url}!", |
16 | "#{url}?", |
17 | "#{url}", |
18 | ].map{|s| CGI::escapeHTML(s)} |
19 | end |
20 | |
21 | def check_correct_conversion(s, url) |
22 | assert url_to_link(s)['<' + url + '>'], 'failed: ' + s + ' gives ' + url_to_link(s) |
23 | end |
24 | |
25 | def check_all_conversions(url) |
26 | make_strings(url).each do |s| |
27 | assert url_to_link(s)['"' + CGI::escapeHTML(url) + '"'], 'failed: ' + s + ' gives ' + url_to_link(s) |
28 | end |
29 | end |
30 | |
31 | def test_simple_url |
32 | url = 'http://www.siwawi.arubi.uni-kl.de/avr_projects/arm_projects' |
33 | check_all_conversions(url) |
34 | end |
35 | |
36 | def test_url_with_parameters |
37 | url = 'http://www.siwawi.arubi.uni-kl.de/avr_projects/arm_projects?x_b=y&a[b]=33' |
38 | check_all_conversions(url) |
39 | end |
40 | |
41 | def test_url_with_parameters_and_anchor |
42 | url = 'http://www.siwawi.arubi.uni-kl.de/avr_projects/arm_projects?x_b=y&[b]=33#asdf_x' |
43 | check_all_conversions(url) |
44 | end |
45 | |
46 | # make sure the processed text with removed tags is the same as the original text |
47 | def test_nothing_gets_lost |
48 | url = "http://xyz" |
49 | make_strings(url).each do |s| |
50 | assert_equal s, url_to_link(s).gsub(/<.+?>/, '') |
51 | end |
52 | end |
53 | |
54 | end |