Wiki2Go 1.17.5 → 1.22.0
Sign up to get free protection for your applications and to get access to all the features.
- data/bin/Wiki2Go_firewall_blacklist.rb +8 -0
- data/bin/Wiki2Go_make_cvs_repository.rb +1 -0
- data/bin/Wiki2Go_make_site.rb +1 -2
- data/bin/Wiki2Go_update_site.rb +1 -2
- data/lib/Web2Go/CGIRequest.rb +8 -2
- data/lib/Web2Go/CGIResponse.rb +17 -14
- data/lib/Web2Go/MockRequest.rb +12 -2
- data/lib/Web2Go/MockResponse.rb +10 -7
- data/lib/Web2Go/WebrickRequest.rb +106 -101
- data/lib/Web2Go/WebrickResponse.rb +4 -8
- data/lib/Wiki2Go/BlackList.rb +48 -25
- data/lib/Wiki2Go/DotGraphics.rb +1 -1
- data/lib/Wiki2Go/FileStorage.rb +266 -266
- data/lib/Wiki2Go/HTMLFormatter.rb +28 -0
- data/lib/Wiki2Go/Install/config/chonqed_blacklist.txt +418 -0
- data/lib/Wiki2Go/Install/config/passwords +1 -1
- data/lib/Wiki2Go/Install/config/url_blacklist.txt +3855 -0
- data/lib/Wiki2Go/Install/make_repository.rb +32 -26
- data/lib/Wiki2Go/Install/make_site.rb +197 -111
- data/lib/Wiki2Go/Install/site/error.html +1 -1
- data/lib/Wiki2Go/Install/site/robots.txt +10 -1
- data/lib/Wiki2Go/Install/site/style.css +129 -64
- data/lib/Wiki2Go/Install/templates/admin.htm +1 -1
- data/lib/Wiki2Go/Install/templates/admin_pages/edit.txt +2 -1
- data/lib/Wiki2Go/Install/templates/admin_pages/format_for_fck.txt +31 -0
- data/lib/Wiki2Go/Install/templates/admin_pages/passwords.txt +1 -1
- data/lib/Wiki2Go/Install/templates/edit.htm +62 -46
- data/lib/Wiki2Go/Install/templates/full_footer.htm +31 -33
- data/lib/Wiki2Go/Install/templates/header.htm +0 -1
- data/lib/Wiki2Go/Install/templates/menu.htm +29 -0
- data/lib/Wiki2Go/Install/templates/pagelist.htm +46 -43
- data/lib/Wiki2Go/Install/templates/simple_footer.htm +20 -16
- data/lib/Wiki2Go/Install/templates/versionlist.htm +52 -40
- data/lib/Wiki2Go/Install/templates/view.htm +46 -29
- data/lib/Wiki2Go/Install/templates/wikiedit.htm +63 -0
- data/lib/Wiki2Go/Install/wiki/delete.png +0 -0
- data/lib/Wiki2Go/Install/wiki/style.css +133 -63
- data/lib/Wiki2Go/LineFormatter.rb +345 -197
- data/lib/Wiki2Go/Page.rb +16 -3
- data/lib/Wiki2Go/PrivateWikiConfig.rb +5 -5
- data/lib/Wiki2Go/PublicWikiConfig.rb +83 -37
- data/lib/Wiki2Go/ReadWriteWikiConfig.rb +8 -8
- data/lib/Wiki2Go/Server.rb +6 -1
- data/lib/Wiki2Go/SpamFilter.rb +32 -41
- data/lib/Wiki2Go/Web.rb +10 -3
- data/lib/Wiki2Go/Wiki2Go.rb +301 -94
- data/lib/Wiki2Go/Wiki2GoConfig.rb +87 -6
- data/lib/Wiki2Go/Wiki2GoServlet.rb +66 -12
- data/lib/Wiki2Go/WikiFormatter.rb +60 -30
- data/lib/Wiki2Go/cgi/diff.rb +20 -0
- data/lib/Wiki2Go/cgi/secure/log_rss.rb +21 -0
- data/lib/Wiki2Go/cgi/sidebyside.rb +20 -0
- data/lib/Wiki2Go/cgi/wikiedit.rb +20 -0
- data/lib/Wiki2Go/firewall_blacklist.rb +88 -0
- data/test/All.rb +5 -2
- data/test/TestBlackList.rb +70 -14
- data/test/TestConfig.rb +5 -5
- data/test/TestDiff.rb +95 -0
- data/test/TestFormatter.rb +14 -16
- data/test/TestHTMLFormatter.rb +37 -0
- data/test/TestInstall.rb +70 -27
- data/test/TestLineFormatter.rb +71 -15
- data/test/TestRSS.rb +8 -7
- data/test/TestRepository.rb +50 -0
- data/test/TestServer.rb +3 -8
- data/test/TestSpamFilter.rb +33 -1
- data/test/TestStorage.rb +11 -0
- data/test/TestWeb.rb +2 -2
- data/test/TestWiki2Go.rb +766 -166
- data/test/TestWiki2GoServlet.rb +1122 -524
- data/test/UnitTestFiles.rb +7 -3
- data/test/Wiki2GoConfigForTest.rb +40 -6
- data/test/checksite.rb +17 -50
- data/test/test_firewall_blacklist.rb +131 -0
- data/test/test_page.rb +45 -0
- data/test/testdata/Registration.rbl.txt +7 -0
- data/test/testdata/config/url_blacklist.txt +38822 -0
- data/test/testdata/expected_changes.html +1 -2
- data/test/testdata/expected_edit.html +108 -59
- data/test/testdata/expected_full_rss.xml +2 -2
- data/test/testdata/expected_out.html +97 -61
- data/test/testdata/expected_put.html +88 -53
- data/test/testdata/expected_save.html +88 -52
- data/test/testdata/expected_savehtml.html +88 -52
- data/test/testdata/expected_search.html +68 -53
- data/test/testdata/expected_upload.html +88 -53
- data/test/testdata/expected_versions.html +97 -82
- data/test/testdata/expected_view.html +97 -61
- data/test/testdata/firewall/iptables.config +37 -0
- data/test/testdata/firewall/user_blacklist.txt +162 -0
- data/test/testdata/logs/wiki.log +652 -0
- data/test/testdata/logs/wiki.log.0 +113 -0
- data/test/testdata/logs/wiki.log.1 +113 -0
- data/test/testdata/logs/wiki.log.2 +113 -0
- data/test/testdata/logs/wiki.log.3 +115 -0
- data/test/testdata/logs/wiki.log.4 +5 -0
- data/test/testdata/logs/wiki.log.5 +7 -0
- data/test/testdata/logs/wiki.log.6 +5 -0
- data/test/testdata/logs/wiki.log.7 +118 -0
- data/test/testdata/logs/wiki.log.8 +12 -0
- data/test/testdata/site/html/Xpday/rss.xml +53 -103
- data/test/testdata/texts/Bugs/FrontPage.txt +6 -0
- data/test/testdata/texts/Bugs/NoHidden.spam +17850 -0
- data/test/testdata/texts/Bugs/PairProgrammingParties.spam +102 -0
- data/test/testdata/texts/Bugs/PairProgrammingParties.txt +99 -0
- metadata +53 -7
- data/test/TestMail.rb +0 -29
- data/test/gc.log +0 -2
@@ -0,0 +1,50 @@
|
|
1
|
+
|
2
|
+
#!/usr/bin/ruby
|
3
|
+
$:.unshift File.expand_path(File.join(File.dirname(__FILE__),'..','lib'))
|
4
|
+
|
5
|
+
|
6
|
+
require 'test/unit'
|
7
|
+
|
8
|
+
require "Wiki2Go/Install/make_site"
|
9
|
+
require "Wiki2Go/Install/make_repository"
|
10
|
+
require 'fileutils'
|
11
|
+
require 'UnitTestFiles'
|
12
|
+
|
13
|
+
include FileUtils
|
14
|
+
|
15
|
+
class TestRepository < Test::Unit::TestCase
|
16
|
+
|
17
|
+
def test_make_repository
|
18
|
+
scratch = scratch_dir('testcvs')
|
19
|
+
repository_dir = File.join(scratch,'repository')
|
20
|
+
wiki_dir = File.join(scratch,'readwrite')
|
21
|
+
user = ENV['USER'] || ENV['USERNAME']
|
22
|
+
args = ['-d', repository_dir , '-u' ,user, '-g' , user, '-m' , 'readwrite']
|
23
|
+
Wiki2Go::RepositoryMaker.create(args)
|
24
|
+
assert File.exists?(repository_dir)
|
25
|
+
|
26
|
+
args = ['-s', 'http://wiki2go.nayima.be/blog' , '-w' , 'Wiki2Go' , '-t' , 'readwrite', '-d' , wiki_dir]
|
27
|
+
Wiki2Go::Install.make_site(args)
|
28
|
+
|
29
|
+
args = ['-d', repository_dir , '-w' ,wiki_dir, '-m' , 'readwrite']
|
30
|
+
added = Wiki2Go::RepositoryMaker.addwiki(args)
|
31
|
+
added = Wiki2Go::RepositoryMaker.addwiki(args)
|
32
|
+
assert_equal 0,added.length
|
33
|
+
args = ['-d', repository_dir , '-w' ,wiki_dir]
|
34
|
+
Wiki2Go::RepositoryMaker.updatewiki(args)
|
35
|
+
end
|
36
|
+
|
37
|
+
|
38
|
+
private
|
39
|
+
|
40
|
+
def scratch_dir(type)
|
41
|
+
dest = UnitTestFiles.scratchdata('wiki',type)
|
42
|
+
if File.exists?(dest) then
|
43
|
+
rm_rf(dest)
|
44
|
+
end
|
45
|
+
mkdir_p dest
|
46
|
+
dest
|
47
|
+
end
|
48
|
+
|
49
|
+
end
|
50
|
+
|
data/test/TestServer.rb
CHANGED
@@ -20,7 +20,7 @@ class TestServer < Test::Unit::TestCase
|
|
20
20
|
assert(!server.nil?)
|
21
21
|
thread = server.start { |config|
|
22
22
|
assert_equal('81',config.port)
|
23
|
-
assert_equal(
|
23
|
+
assert_equal(Dir.getwd,config.root_directory)
|
24
24
|
assert_equal(true,config.multi_wiki)
|
25
25
|
}
|
26
26
|
sleep(5) # Let the webserver start
|
@@ -41,10 +41,10 @@ class TestServer < Test::Unit::TestCase
|
|
41
41
|
assert(!server.nil?)
|
42
42
|
thread = server.start { |config|
|
43
43
|
assert_equal('81',config.port)
|
44
|
-
assert_equal(
|
44
|
+
assert_equal(Dir.getwd,config.root_directory)
|
45
45
|
assert_equal(false,config.multi_wiki)
|
46
46
|
}
|
47
|
-
sleep(
|
47
|
+
sleep(15) # Let the webserver start
|
48
48
|
|
49
49
|
Net::HTTP.start('localhost', 81) { |http|
|
50
50
|
response = http.get('/view/FrontPage')
|
@@ -58,8 +58,3 @@ class TestServer < Test::Unit::TestCase
|
|
58
58
|
|
59
59
|
end
|
60
60
|
|
61
|
-
|
62
|
-
if $0 == __FILE__
|
63
|
-
RUNIT::CUI::TestRunner.run(TestServer.suite)
|
64
|
-
end
|
65
|
-
|
data/test/TestSpamFilter.rb
CHANGED
@@ -24,7 +24,7 @@ class SpamMockStorage
|
|
24
24
|
end
|
25
25
|
end
|
26
26
|
|
27
|
-
def load_blacklist(type)
|
27
|
+
def load_blacklist(type,normalize_urls=false)
|
28
28
|
@blacklists[type] = Wiki2Go::BlackList.new(type,[]) if !@blacklists.has_key?(type)
|
29
29
|
@blacklists[type]
|
30
30
|
end
|
@@ -125,6 +125,38 @@ class TestSpamFilter < Test::Unit::TestCase
|
|
125
125
|
|
126
126
|
end
|
127
127
|
|
128
|
+
def test_spamfilter_recognizes_attempts_to_hide_stuff
|
129
|
+
content = <<HIDDEN_SPAM
|
130
|
+
[BernardVanderBeken] NakedObjects ( http://www.nakedobjects.org ) are an interesting way of implementing a system. A pair could explore this Java/.NET framework in order to learn about the benefits.
|
131
|
+
336275370206207295404361
|
132
|
+
<u style="display:none;"> Beneficiaries the on tri-pak
|
133
|
+
zithromax copy [ ] patients. National hct
|
134
|
+
loprox
|
135
|
+
lorabid
|
136
|
+
lorazepam
|
137
|
+
lorazepam [ ] considers united within good generic are xr
|
138
|
+
ciprodex
|
139
|
+
ciprofloxacin program's the.</u>
|
140
|
+
HIDDEN_SPAM
|
141
|
+
|
142
|
+
assert @spam_filter.hidden_text_in(content)
|
143
|
+
assert @spam_filter.hidden_text_in('<u style = "color:white; display:none;"> Beneficiaries the on tri-pak')
|
144
|
+
assert !@spam_filter.hidden_text_in("style = \"display:none\"")
|
145
|
+
end
|
128
146
|
|
147
|
+
def test_spamfilter_recognizes_empty_urls
|
148
|
+
content = <<EMPTY_URLS
|
149
|
+
<a href=" "> </a>
|
150
|
+
EMPTY_URLS
|
151
|
+
|
152
|
+
assert @spam_filter.empty_urls_in(content)
|
153
|
+
end
|
154
|
+
|
155
|
+
def test_spamfilter_detects_clearing_a_page
|
156
|
+
assert @spam_filter.cleared_page?('')
|
157
|
+
assert @spam_filter.cleared_page?(" \r\n \t \r \n")
|
158
|
+
|
159
|
+
assert !@spam_filter.cleared_page?(" \r\n a word \t \r \n")
|
160
|
+
end
|
129
161
|
|
130
162
|
end
|
data/test/TestStorage.rb
CHANGED
@@ -130,6 +130,17 @@ class TestStorage < Test::Unit::TestCase
|
|
130
130
|
assert_equal(page1.name,matches[0].name)
|
131
131
|
end
|
132
132
|
|
133
|
+
|
134
|
+
def test_search_accepts_all_input
|
135
|
+
page1 = Wiki2Go::Page.new("FrontPage",[ "The Wiki2Go homepage", 'by the Wiki2Go team'], "pvc",Time.now,"FrontPage")
|
136
|
+
@storage.save_page("Wiki2Go",page1)
|
137
|
+
page2 = Wiki2Go::Page.new("OtherPage",[ 'Some other stuff', 'about Wiki2Go'], "pvc",Time.now,"OtherPage")
|
138
|
+
@storage.save_page("Wiki2Go",page1)
|
139
|
+
|
140
|
+
matches = @storage.search("Wiki2Go",'/Hi[url=http:\/\/uk.geocities.com\/autorentalcar\/car-rental-companies.html]car rental companies[\/url]')
|
141
|
+
assert_equal(0,matches.length)
|
142
|
+
end
|
143
|
+
|
133
144
|
def test_save_spam
|
134
145
|
content = ['line1', 'Line with spam']
|
135
146
|
@storage.save_spam('Xpday','SpamPage',content,'Me')
|
data/test/TestWeb.rb
CHANGED
@@ -132,11 +132,11 @@ class TestWeb < Test::Unit::TestCase
|
|
132
132
|
def test_login
|
133
133
|
env = {"HTTP_HOST"=>"wiki.xp.be", "HTTP_REFERER"=>"http://wiki.xp.be/scripts/view/Xpbe/PairProgrammingParty2004September14", "HTTP_USER_AGENT"=>"Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.5) Gecko/20041107 Firefox/1.0", "PATH"=>"/sbin:/bin:/usr/sbin:/usr/bin:/usr/bin/X11:/usr/local/sbin:/usr/local/bin", "REMOTE_ADDR"=>"80.200.195.232", "REMOTE_PORT"=>"62539", "SCRIPT_FILENAME"=>"/home/pvc/sites/xpbe/wiki2/site//view", "SERVER_ADDR"=>"212.13.211.135", "SERVER_ADMIN"=>"webmaster@nayima.vm.bytemark.co.uk", "SERVER_NAME"=>"wiki.xp.be", "SERVER_PORT"=>"80", "SERVER_SIGNATURE"=>"<ADDRESS>Apache/1.3.26 Server at wiki.xp.be Port 80</ADDRESS>\n", "SERVER_SOFTWARE"=>"Apache/1.3.26 (Unix) Debian GNU/Linux PHP/4.1.2", "GATEWAY_INTERFACE"=>"CGI/1.1", "SERVER_PROTOCOL"=>"HTTP/1.1", "REQUEST_METHOD"=>"GET", "QUERY_STRING"=>"", "REQUEST_URI"=>"/scripts/view/Xpbe/PairProgrammingParties", "SCRIPT_NAME"=>"/scripts/view", "PATH_INFO"=>"/Xpbe/PairProgrammingParties"}
|
134
134
|
web = Wiki2Go::Web.from_request(Web2Go::MockRequest.new('http://wiki.xp.be/scripts/view/Xpbe/PairProgrammingParties',env),@config)
|
135
|
-
assert(!web.secure)
|
135
|
+
assert(!web.secure?)
|
136
136
|
env["AUTH_TYPE"] = "Basic"
|
137
137
|
env["REMOTE_USER"] = "Pascal"
|
138
138
|
web = Wiki2Go::Web.from_request(Web2Go::MockRequest.new('http://wiki.xp.be/scripts/view/Xpbe/PairProgrammingParties',env),@config)
|
139
|
-
assert(web.secure)
|
139
|
+
assert(web.secure?)
|
140
140
|
assert_equal("Pascal",web.user)
|
141
141
|
end
|
142
142
|
|
data/test/TestWiki2Go.rb
CHANGED
@@ -4,8 +4,9 @@ $:.unshift File.expand_path(File.join(File.dirname(__FILE__),'..','lib'))
|
|
4
4
|
|
5
5
|
require 'test/unit'
|
6
6
|
|
7
|
-
require "Wiki2Go/WikiFormatter"
|
8
7
|
require "Wiki2Go/Wiki2Go"
|
8
|
+
|
9
|
+
require "Wiki2Go/WikiFormatter"
|
9
10
|
require "Wiki2Go/Web"
|
10
11
|
require "Wiki2Go/FileStorage"
|
11
12
|
require "Wiki2GoConfigForTest"
|
@@ -16,169 +17,768 @@ require "UnitTestFiles"
|
|
16
17
|
|
17
18
|
class TestWiki2Go < Test::Unit::TestCase
|
18
19
|
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
20
|
+
include UnitTestFiles
|
21
|
+
|
22
|
+
def setup
|
23
|
+
UnitTestFiles.clean
|
24
|
+
FileUtils.mkdir_p UnitTestFiles.scratchdata
|
25
|
+
@config = TestDataWiki2GoConfig.new
|
26
|
+
end
|
27
|
+
|
28
|
+
def teardown
|
29
|
+
@config.close unless @config.nil?
|
30
|
+
end
|
31
|
+
|
32
|
+
def test_view
|
33
|
+
wiki = Wiki2Go::Wiki.new(@config)
|
34
|
+
|
35
|
+
wikiweb = Wiki2Go::Web.from_page_url("http://localhost/view/Xpday/FrontPage","view",@config)
|
36
|
+
|
37
|
+
html = wiki.view(wikiweb,-1)
|
38
|
+
|
39
|
+
assert_same_file_string(testdata('expected_view.html'),scratchdata('generated_view.html'),html)
|
40
|
+
|
41
|
+
end
|
42
|
+
|
43
|
+
def test_versions
|
44
|
+
@config.close
|
45
|
+
@config = ScratchWikiConfig.new
|
46
|
+
wiki = Wiki2Go::Wiki.new(@config)
|
47
|
+
|
48
|
+
wikiweb = Wiki2Go::Web.from_request(Web2Go::MockRequest.new('http://localhost/view/Xpday/FrontPage',{ 'REMOTE_USER' => 'goodgirl'} ),@config)
|
49
|
+
wiki.save(wikiweb,"edited by good girl")
|
50
|
+
|
51
|
+
wikiweb = Wiki2Go::Web.from_request(Web2Go::MockRequest.new('http://localhost/view/Xpday/FrontPage',{ 'REMOTE_USER' => 'evilguy'} ),@config)
|
52
|
+
wiki.save(wikiweb,"edited by nasty man who spams")
|
53
|
+
|
54
|
+
wikiweb = Wiki2Go::Web.from_request(Web2Go::MockRequest.new('http://localhost/view/Xpday/FrontPage',{ 'REMOTE_USER' => 'goodguy'} ),@config)
|
55
|
+
wiki.save(wikiweb,"edited by good boy")
|
56
|
+
|
57
|
+
wikiweb = Wiki2Go::Web.from_page_url("http://localhost/versions/Xpday/FrontPage","versions",@config)
|
58
|
+
|
59
|
+
blacklist = @config.banned_users
|
60
|
+
blacklist.add('evilguy')
|
61
|
+
|
62
|
+
html = wiki.versions(wikiweb)
|
63
|
+
# puts html
|
64
|
+
|
65
|
+
assert_same_file_string(testdata('expected_versions.html'),scratchdata('generated_versions.html'),html, { "DATE" => Time.new.strftime("%d/%m/%Y") })
|
66
|
+
|
67
|
+
wikiweb = Wiki2Go::Web.from_request(Web2Go::MockRequest.new('http://localhost/view/Xpday/FrontPage?version=0' ),@config)
|
68
|
+
|
69
|
+
html = wiki.view(wikiweb,0)
|
70
|
+
|
71
|
+
assert_match(/edited by good girl/,html,'version 0 should be the first edit')
|
72
|
+
|
73
|
+
# puts html
|
74
|
+
|
75
|
+
wikiweb = Wiki2Go::Web.from_request(Web2Go::MockRequest.new('http://localhost/view/Xpday/FrontPage?version=1' ),@config)
|
76
|
+
|
77
|
+
html = wiki.view(wikiweb,1)
|
78
|
+
assert_match(/edited by good boy/,html,'version 1 should be the edit after the spammer')
|
79
|
+
|
80
|
+
# puts html
|
81
|
+
|
82
|
+
wikiweb = Wiki2Go::Web.from_request(Web2Go::MockRequest.new('http://localhost/view/Xpday/FrontPage?version=2' ),@config)
|
83
|
+
|
84
|
+
html = wiki.view(wikiweb,2)
|
85
|
+
assert_match(/edited by good boy/,html,'version 1 should be the edit after the spammer')
|
86
|
+
|
87
|
+
# puts html
|
88
|
+
end
|
89
|
+
|
90
|
+
def test_diff
|
91
|
+
@config.close
|
92
|
+
@config = ScratchWikiConfig.new
|
93
|
+
wiki = Wiki2Go::Wiki.new(@config)
|
94
|
+
|
95
|
+
wikiweb = Wiki2Go::Web.from_request(Web2Go::MockRequest.new('http://localhost/view/Xpday/FrontPage',{ 'REMOTE_USER' => 'goodgirl'} ),@config)
|
96
|
+
wiki.save(wikiweb,"start<br>edited by *good girl & boy*\nI want a pony!")
|
97
|
+
|
98
|
+
wikiweb = Wiki2Go::Web.from_request(Web2Go::MockRequest.new('http://localhost/view/Xpday/FrontPage',{ 'REMOTE_USER' => 'goodboy'} ),@config)
|
99
|
+
wiki.save(wikiweb,"start<br />edited by *good girl & boy*\nI hate ponies!")
|
100
|
+
|
101
|
+
html = wiki.diff(wikiweb,0,1)
|
102
|
+
# puts html
|
103
|
+
assert_same_markup_strings(expected_diff,html, { "DATE" => Time.new.strftime("%d/%m/%Y") })
|
104
|
+
|
105
|
+
end
|
106
|
+
|
107
|
+
def test_diff_with_multiple_versions
|
108
|
+
@config.close
|
109
|
+
@config = ScratchWikiConfig.new
|
110
|
+
wiki = Wiki2Go::Wiki.new(@config)
|
111
|
+
|
112
|
+
wikiweb = Wiki2Go::Web.from_request(Web2Go::MockRequest.new('http://localhost/view/Xpday/FrontPage',{ 'REMOTE_USER' => 'goodgirl'} ),@config)
|
113
|
+
wiki.save(wikiweb,"Edited by good girl\nVersion 0")
|
114
|
+
|
115
|
+
wikiweb = Wiki2Go::Web.from_request(Web2Go::MockRequest.new('http://localhost/view/Xpday/FrontPage',{ 'REMOTE_USER' => 'goodboy'} ),@config)
|
116
|
+
wikiweb.title = "Front Page"
|
117
|
+
wiki.save(wikiweb,"Edited by good boy\nVersion 1")
|
118
|
+
|
119
|
+
wikiweb = Wiki2Go::Web.from_request(Web2Go::MockRequest.new('http://localhost/view/Xpday/FrontPage',{ 'REMOTE_USER' => 'goodgirl'} ),@config)
|
120
|
+
wiki.save(wikiweb,"Edited by good girl\nVersion 2")
|
121
|
+
|
122
|
+
wikiweb = Wiki2Go::Web.from_request(Web2Go::MockRequest.new('http://localhost/view/Xpday/FrontPage',{ 'REMOTE_USER' => 'goodboy'} ),@config)
|
123
|
+
wiki.save(wikiweb,"Edited by good boy\nVersion 3")
|
124
|
+
|
125
|
+
wikiweb = Wiki2Go::Web.from_request(Web2Go::MockRequest.new('http://localhost/view/Xpday/FrontPage',{ 'REMOTE_USER' => 'goodgirl'} ),@config)
|
126
|
+
wiki.save(wikiweb,"Edited by good girl\nVersion 4")
|
127
|
+
|
128
|
+
html = wiki.diff(wikiweb,1,2)
|
129
|
+
# puts html
|
130
|
+
assert_same_markup_strings(expected_diff_with_multiple_versions,html, { "DATE" => Time.new.strftime("%d/%m/%Y") })
|
131
|
+
|
132
|
+
html = wiki.diff(wikiweb,1,3)
|
133
|
+
assert_same_markup_strings(expected_diff_with_multiple_separated_versions,html, { "DATE" => Time.new.strftime("%d/%m/%Y") })
|
134
|
+
|
135
|
+
end
|
136
|
+
|
137
|
+
def test_sidebyside
|
138
|
+
@config.close
|
139
|
+
@config = ScratchWikiConfig.new
|
140
|
+
wiki = Wiki2Go::Wiki.new(@config)
|
141
|
+
|
142
|
+
wikiweb = Wiki2Go::Web.from_request(Web2Go::MockRequest.new('http://localhost/view/Xpday/FrontPage',{ 'REMOTE_USER' => 'goodgirl'} ),@config)
|
143
|
+
wiki.save(wikiweb,"start<br>edited by *good girl & boy*\nI want a pony!")
|
144
|
+
|
145
|
+
wikiweb = Wiki2Go::Web.from_request(Web2Go::MockRequest.new('http://localhost/view/Xpday/FrontPage',{ 'REMOTE_USER' => 'goodboy'} ),@config)
|
146
|
+
wiki.save(wikiweb,"start<br />edited by *good girl & boy*\nI hate ponies!")
|
147
|
+
|
148
|
+
html = wiki.sidebyside(wikiweb,0,1)
|
149
|
+
# puts html
|
150
|
+
assert_same_markup_strings(expected_sidebyside,html, { "DATE" => Time.new.strftime("%d/%m/%Y") })
|
151
|
+
|
152
|
+
end
|
153
|
+
|
154
|
+
def test_edit
|
155
|
+
wiki = Wiki2Go::Wiki.new(@config)
|
156
|
+
|
157
|
+
wikiweb = Wiki2Go::Web.from_page_url("http://localhost/edit/Xpday/FrontPage","edit",@config)
|
158
|
+
|
159
|
+
html = wiki.edit(wikiweb)
|
160
|
+
|
161
|
+
assert_same_file_string(testdata('expected_edit.html'),scratchdata('generated_edit.html'),html)
|
162
|
+
|
163
|
+
end
|
164
|
+
|
165
|
+
def test_save
|
166
|
+
@config.close
|
167
|
+
@config = TestWiki2GoConfig.new
|
168
|
+
assert(!@config.generate_html)
|
169
|
+
wiki = Wiki2Go::Wiki.new(@config)
|
170
|
+
|
171
|
+
wikiweb = Wiki2Go::Web.from_page_url("http://localhost/view/Xpday/FrontPage","view",@config)
|
172
|
+
wiki.save(wikiweb,"FrontPage")
|
173
|
+
|
174
|
+
wikiweb = Wiki2Go::Web.from_page_url("http://localhost/view/Xpday/test","view",@config)
|
175
|
+
wikiweb.title = "FrontPagename"
|
176
|
+
redirect_url = wiki.save(wikiweb,"FrontPage")
|
177
|
+
assert_equal("http://localhost/view/Xpday/test",redirect_url)
|
178
|
+
|
179
|
+
html = wiki.view(wikiweb,-1)
|
180
|
+
|
181
|
+
assert_same_file_string(testdata('expected_save.html'),scratchdata('generated_save.html'),html, { "DATE" => Time.new.strftime("%d/%m/%Y") } )
|
182
|
+
|
183
|
+
end
|
184
|
+
|
185
|
+
|
186
|
+
|
187
|
+
def test_save_with_html
|
188
|
+
@config.close
|
189
|
+
@config = TestWiki2GoConfig.new
|
190
|
+
@config.generate_html = true
|
191
|
+
|
192
|
+
wiki = Wiki2Go::Wiki.new(@config)
|
193
|
+
|
194
|
+
wikiweb = Wiki2Go::Web.from_page_url("http://localhost/view/Xpday/FrontPage","view",@config)
|
195
|
+
wiki.save(wikiweb,"FrontPage")
|
196
|
+
|
197
|
+
wikiweb = Wiki2Go::Web.from_page_url("http://localhost/view/Xpday/test","view",@config)
|
198
|
+
|
199
|
+
root = @config.site_directory
|
200
|
+
path = File.join(root,wikiweb.name, wikiweb.current_page + ".html")
|
201
|
+
File.delete(path) if File.exists?(path)
|
202
|
+
|
203
|
+
wikiweb.title = "Frontpagename"
|
204
|
+
redirect_url = wiki.save(wikiweb,"FrontPage")
|
205
|
+
assert_equal("http://localhost/Xpday/test.html",redirect_url)
|
206
|
+
|
207
|
+
assert(File.exists?(path))
|
208
|
+
assert_same_file(testdata('expected_savehtml.html'),path, { "DATE" => Time.new.strftime("%d/%m/%Y") } )
|
209
|
+
|
210
|
+
end
|
211
|
+
|
212
|
+
def test_generate_static
|
213
|
+
@config.close
|
214
|
+
@config = PrivateTestWiki2GoConfig.new
|
215
|
+
|
216
|
+
wiki = Wiki2Go::Wiki.new(@config)
|
217
|
+
|
218
|
+
request = Web2Go::MockRequest.new('http://localhost:8088/generate_static/NonExistingWeb/FrontPage')
|
219
|
+
request.authenticated = true
|
220
|
+
request.user = 'admin'
|
221
|
+
wikiweb = Wiki2Go::Web.from_request(request,@config)
|
222
|
+
wiki.save(wikiweb,"FrontPage")
|
223
|
+
# puts wiki.generate_html(wikiweb)
|
224
|
+
end
|
225
|
+
|
226
|
+
def test_format_for_fckeditor
|
227
|
+
@config.close
|
228
|
+
@config = TestWiki2GoConfig.new
|
229
|
+
wiki = Wiki2Go::Wiki.new(@config)
|
230
|
+
|
231
|
+
wikiweb = Wiki2Go::Web.page_url("localhost","80","/save/Xpday/SimplePage","save",@config)
|
232
|
+
wikiweb.title = 'simple'
|
233
|
+
wiki.save(wikiweb,'A simple page\n')
|
234
|
+
|
235
|
+
wikiweb = Wiki2Go::Web.page_url("localhost","80","/save/Xpday/OtherPage","save",@config)
|
236
|
+
wikiweb.title = 'other'
|
237
|
+
wiki.save(wikiweb,'A simple page\n')
|
238
|
+
|
239
|
+
|
240
|
+
wikiweb = Wiki2Go::Web.from_page_url("http://localhost/admin/Xpday/","admin",@config)
|
241
|
+
|
242
|
+
html = wiki.prepare_for_fckeditor(wikiweb)
|
243
|
+
|
244
|
+
dir = @config.root_directory
|
245
|
+
assert File.exists?(File.join(dir,'texts','Xpday','OtherPage.txt'))
|
246
|
+
assert File.exists?(File.join(dir,'texts','Xpday','OtherPage.bak'))
|
247
|
+
assert File.exists?(File.join(dir,'texts','Xpday','SimplePage.txt'))
|
248
|
+
assert File.exists?(File.join(dir,'texts','Xpday','SimplePage.bak'))
|
249
|
+
end
|
250
|
+
|
251
|
+
def test_changes
|
252
|
+
wiki = Wiki2Go::Wiki.new(@config)
|
253
|
+
|
254
|
+
wikiweb = Wiki2Go::Web.page_url("localhost","80","/upload/Xpday","changes",@config)
|
255
|
+
|
256
|
+
html = wiki.changes(wikiweb)
|
257
|
+
|
258
|
+
# assert_same_file_string(testdata('expected_changes.html'),scratchdata('generated_changes.html'),html, { "DATE" => Time.new.strftime("%d/%m/%Y") })
|
259
|
+
|
260
|
+
end
|
261
|
+
|
262
|
+
def test_search
|
263
|
+
wiki = Wiki2Go::Wiki.new(@config)
|
264
|
+
|
265
|
+
wikiweb = Wiki2Go::Web.page_url("localhost","80","/search/Xpday","search",@config)
|
266
|
+
|
267
|
+
html = wiki.search(wikiweb,"Benelux")
|
268
|
+
|
269
|
+
assert_same_file_string(testdata('expected_search.html'),scratchdata('generated_search.html'),html, { "DATE" => Time.new.strftime("%d/%m/%Y") })
|
270
|
+
|
271
|
+
end
|
272
|
+
|
273
|
+
def test_upload_files
|
274
|
+
@config.close
|
275
|
+
@config = TestWiki2GoConfig.new
|
276
|
+
wiki = Wiki2Go::Wiki.new(@config)
|
277
|
+
|
278
|
+
wikiweb = Wiki2Go::Web.page_url("localhost","80","/upload/Xpday/UploadPage","upload",@config)
|
279
|
+
wikiweb.title = 'simple'
|
280
|
+
wiki.save(wikiweb,'A simple page\n')
|
281
|
+
|
282
|
+
redirect = wiki.upload(wikiweb,"brol.txt","hello peops")
|
283
|
+
assert_equal 'http://localhost/view/Xpday/UploadPage',redirect
|
284
|
+
|
285
|
+
html = wiki.view(wikiweb,-1)
|
286
|
+
assert_same_file_string(testdata('expected_upload.html'),scratchdata('generated_upload.html'),html, { "DATE" => Time.new.strftime("%d/%m/%Y") })
|
287
|
+
|
288
|
+
redirect = wiki.upload(wikiweb,'',nil)
|
289
|
+
assert_equal 'http://localhost/view/Xpday/UploadPage',redirect
|
290
|
+
|
291
|
+
html = wiki.view(wikiweb,-1)
|
292
|
+
assert_same_file_string(testdata('expected_upload.html'),scratchdata('generated_upload.html'),html, { "DATE" => Time.new.strftime("%d/%m/%Y") })
|
293
|
+
|
294
|
+
end
|
295
|
+
|
296
|
+
def test_default_admin_page
|
297
|
+
wiki = Wiki2Go::Wiki.new(TestWiki2GoConfig.new)
|
298
|
+
request = Web2Go::MockRequest.new('http://localhost/admin')
|
299
|
+
|
300
|
+
result = wiki.admin(request)
|
301
|
+
|
302
|
+
request = Web2Go::MockRequest.new('http://localhost/admin/regenerate')
|
303
|
+
|
304
|
+
result = wiki.admin(request)
|
305
|
+
|
306
|
+
end
|
307
|
+
|
308
|
+
def test_hanging_frontpage
|
309
|
+
wiki = Wiki2Go::Wiki.new(@config)
|
310
|
+
|
311
|
+
wikiweb = Wiki2Go::Web.page_url("localhost","80","/view/Bugs/FrontPage","view",@config)
|
312
|
+
# puts wiki.view(wikiweb,-1)
|
313
|
+
end
|
314
|
+
|
315
|
+
private
|
316
|
+
|
317
|
+
def expected_diff_with_multiple_versions
|
318
|
+
return <<END_EXPECTED_DIFF
|
319
|
+
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
320
|
+
<HTML>
|
321
|
+
<HEAD>
|
322
|
+
<META http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
323
|
+
<META http-equiv="Pragma" content="no-cache">
|
324
|
+
<META name="Author" content="Pascal Van Cauwenberghe">
|
325
|
+
<META name="Keywords" content="ruby,wiki">
|
326
|
+
<LINK rel="stylesheet" href="/html/Xpday/style.css" type="text/css">
|
327
|
+
<LINK rel="alternate" type="application/rss+xml" title="RSS 2.0 feed" href="/html/Xpday/rss.xml">
|
328
|
+
<TITLE>
|
329
|
+
|
330
|
+
Xpday
|
331
|
+
-
|
332
|
+
|
333
|
+
FrontPage
|
334
|
+
</TITLE>
|
335
|
+
</HEAD>
|
336
|
+
<BODY>
|
337
|
+
<table id="container">
|
338
|
+
<tr>
|
339
|
+
<td colspan="2" id="header">
|
340
|
+
<TABLE border="0" cellpadding="0" cellspacing="0" width="95%" class="Header">
|
341
|
+
<TR>
|
342
|
+
<TD><h1><a href="/search/Xpday?text=FrontPage" rel="nofollow">FrontPage</a>
|
343
|
+
|
344
|
+
<a href="/view/Xpday/FrontPage">v.2</a>
|
345
|
+
|
346
|
+
</h1>
|
347
|
+
</TD>
|
348
|
+
<td align="right"><a href="/view/Xpday/FrontPage">Home</a></td>
|
349
|
+
</TR>
|
350
|
+
</TABLE>
|
351
|
+
</td>
|
352
|
+
</tr>
|
353
|
+
<tr>
|
354
|
+
<td id="menu" valign="top" nowrap>
|
355
|
+
|
356
|
+
<ul>
|
357
|
+
<li>
|
358
|
+
<a href="/versions/Xpday/FrontPage" rel="nofollow">Page History</a>
|
359
|
+
</li>
|
360
|
+
|
361
|
+
<li>
|
362
|
+
<a href="/sidebyside/Xpday/FrontPage?from=1&to=2" rel="nofollow">What changed?</a>
|
363
|
+
</li>
|
364
|
+
|
365
|
+
<li>
|
366
|
+
<a href="/diff/Xpday/FrontPage?from=1&to=2" rel="nofollow">Diff</a>
|
367
|
+
</li>
|
368
|
+
<li>
|
369
|
+
<a href="/wikiedit/Xpday/FrontPage" rel="nofollow">Edit this page</a>
|
370
|
+
</li>
|
371
|
+
</ul>
|
372
|
+
<hr>
|
373
|
+
|
374
|
+
<ul>
|
375
|
+
<li>
|
376
|
+
<a href="/changes/Xpday" rel="nofollow">Recent changes</a>
|
377
|
+
</li>
|
378
|
+
<li>
|
379
|
+
<a href="/html/Xpday/rss.xml"><img src="/html/rssLogo.png" width="36" height="14" border="0" alt="Keep up to date"></a>
|
380
|
+
</li>
|
381
|
+
</ul>
|
382
|
+
</td>
|
383
|
+
<td id="body" width="100%" valign="top">
|
384
|
+
<strong>FrontPage <a href="/diff/Xpday/FrontPage?from=0&to=2" rel="nofollow"><<</a> <a href="/view/Xpday/FrontPage?version=1">v1 (by goodboy)</a> => <a href="/view/Xpday/FrontPage?version=2">v2 (by goodgirl)</a> <a href="/diff/Xpday/FrontPage?from=1&to=3" rel="nofollow">>></a></strong>
|
385
|
+
<hr>
|
386
|
+
|
387
|
+
<div class=\"diff_deleted\">< Edited by good boy</div>
|
388
|
+
<div class=\"diff_added\">> Edited by good girl</div>
|
389
|
+
<div class=\"diff_deleted\">< Version 1</div>
|
390
|
+
<div class=\"diff_added\">> Version 2</div>
|
391
|
+
</td>
|
392
|
+
</tr>
|
393
|
+
<tr>
|
394
|
+
<td colspan="2" id="footer">
|
395
|
+
<TABLE border="0" cellpadding="0" cellspacing="0" width="100%" class="Footer">
|
396
|
+
<TR>
|
397
|
+
<TD width="50%">
|
398
|
+
|
399
|
+
<a href="/sidebyside/Xpday/FrontPage?from=1&to=2" rel="nofollow">Changed</a>
|
400
|
+
on
|
401
|
+
DATE
|
402
|
+
by
|
403
|
+
<a href="/search/Xpday?text=goodgirl" rel="nofollow">goodgirl</a>
|
404
|
+
|
405
|
+
</TD>
|
406
|
+
<TD width="50%" align="right">
|
407
|
+
Contact the site administrator:
|
408
|
+
<a href="/view/Xpday/MailFormattingRules" rel="nofollow" onmouseover="this.href='mai' + 'lto:' + 'wiki2go' + '@' + 'nayima.be'">wiki2go</a>
|
409
|
+
</TD>
|
410
|
+
</TR>
|
411
|
+
<tr><td colspan="2"><hr></td></tr>
|
412
|
+
<tr>
|
413
|
+
<td><FORM action="/search/Xpday" method="post" id="search" name="search">
|
414
|
+
Search for <INPUT name="text" size="30" ID="Text1"> <input type="submit" name="Go" value="Go">
|
415
|
+
</FORM>
|
416
|
+
</td>
|
417
|
+
<td>
|
418
|
+
|
419
|
+
</td>
|
420
|
+
</tr>
|
421
|
+
</TABLE>
|
422
|
+
</td>
|
423
|
+
</tr>
|
424
|
+
</table>
|
425
|
+
<span style="float:right">
|
426
|
+
<a target="_blank" href="http://validator.w3.org/check?uri=http://localhost/view/Xpday/FrontPage">
|
427
|
+
<img border="0" src="/html/valid-html401.png" alt="Verify if layout is correct!" height="31" width="88"></a>
|
428
|
+
</span>
|
429
|
+
</BODY>
|
430
|
+
</HTML>
|
431
|
+
END_EXPECTED_DIFF
|
432
|
+
end
|
433
|
+
|
434
|
+
def expected_diff_with_multiple_separated_versions
|
435
|
+
return <<END_EXPECTED_DIFF
|
436
|
+
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
437
|
+
<HTML>
|
438
|
+
<HEAD>
|
439
|
+
<META http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
440
|
+
<META http-equiv="Pragma" content="no-cache">
|
441
|
+
<META name="Author" content="Pascal Van Cauwenberghe">
|
442
|
+
<META name="Keywords" content="ruby,wiki">
|
443
|
+
<LINK rel="stylesheet" href="/html/Xpday/style.css" type="text/css">
|
444
|
+
<LINK rel="alternate" type="application/rss+xml" title="RSS 2.0 feed" href="/html/Xpday/rss.xml">
|
445
|
+
<TITLE>
|
446
|
+
|
447
|
+
Xpday
|
448
|
+
-
|
449
|
+
|
450
|
+
FrontPage
|
451
|
+
</TITLE>
|
452
|
+
</HEAD>
|
453
|
+
<BODY>
|
454
|
+
<table id="container">
|
455
|
+
<tr>
|
456
|
+
<td colspan="2" id="header">
|
457
|
+
<TABLE border="0" cellpadding="0" cellspacing="0" width="95%" class="Header">
|
458
|
+
<TR>
|
459
|
+
<TD><h1><a href="/search/Xpday?text=FrontPage" rel="nofollow">FrontPage</a>
|
460
|
+
|
461
|
+
<a href="/view/Xpday/FrontPage">v.3</a>
|
462
|
+
|
463
|
+
</h1>
|
464
|
+
</TD>
|
465
|
+
<td align="right"><a href="/view/Xpday/FrontPage">Home</a></td>
|
466
|
+
</TR>
|
467
|
+
</TABLE>
|
468
|
+
</td>
|
469
|
+
</tr>
|
470
|
+
<tr>
|
471
|
+
<td id="menu" valign="top" nowrap>
|
472
|
+
|
473
|
+
<ul>
|
474
|
+
<li>
|
475
|
+
<a href="/versions/Xpday/FrontPage" rel="nofollow">Page History</a>
|
476
|
+
</li>
|
477
|
+
|
478
|
+
<li>
|
479
|
+
<a href="/sidebyside/Xpday/FrontPage?from=1&to=3" rel="nofollow">What changed?</a>
|
480
|
+
</li>
|
481
|
+
|
482
|
+
<li>
|
483
|
+
<a href="/diff/Xpday/FrontPage?from=1&to=3" rel="nofollow">Diff</a>
|
484
|
+
</li>
|
485
|
+
<li>
|
486
|
+
<a href="/wikiedit/Xpday/FrontPage" rel="nofollow">Edit this page</a>
|
487
|
+
</li>
|
488
|
+
</ul>
|
489
|
+
<hr>
|
490
|
+
|
491
|
+
<ul>
|
492
|
+
<li>
|
493
|
+
<a href="/changes/Xpday" rel="nofollow">Recent changes</a>
|
494
|
+
</li>
|
495
|
+
<li>
|
496
|
+
<a href="/html/Xpday/rss.xml"><img src="/html/rssLogo.png" width="36" height="14" border="0" alt="Keep up to date"></a>
|
497
|
+
</li>
|
498
|
+
</ul>
|
499
|
+
</td>
|
500
|
+
<td id="body" width="100%" valign="top">
|
501
|
+
<strong>FrontPage <a href="/diff/Xpday/FrontPage?from=0&to=3" rel="nofollow"><<</a> <a href="/view/Xpday/FrontPage?version=1">v1 (by goodboy)</a> <a href="/diff/Xpday/FrontPage?from=2&to=3" rel="nofollow">>></a> => <a href="/diff/Xpday/FrontPage?from=1&to=2" rel="nofollow"><<</a> <a href="/view/Xpday/FrontPage?version=3">v3 (by goodboy)</a> <a href="/diff/Xpday/FrontPage?from=1&to=4" rel="nofollow">>></a></strong>
|
502
|
+
<hr>
|
503
|
+
|
504
|
+
<div class=\"diff_kept\">= Edited by good boy</div>
|
505
|
+
<div class=\"diff_deleted\">< Version 1</div>
|
506
|
+
<div class=\"diff_added\">> Version 3</div>
|
507
|
+
</td>
|
508
|
+
</tr>
|
509
|
+
<tr>
|
510
|
+
<td colspan="2" id="footer">
|
511
|
+
<TABLE border="0" cellpadding="0" cellspacing="0" width="100%" class="Footer">
|
512
|
+
<TR>
|
513
|
+
<TD width="50%">
|
514
|
+
|
515
|
+
<a href="/sidebyside/Xpday/FrontPage?from=1&to=3" rel="nofollow">Changed</a>
|
516
|
+
on
|
517
|
+
DATE
|
518
|
+
by
|
519
|
+
<a href="/search/Xpday?text=goodboy" rel="nofollow">goodboy</a>
|
520
|
+
|
521
|
+
</TD>
|
522
|
+
<TD width="50%" align="right">
|
523
|
+
Contact the site administrator:
|
524
|
+
<a href="/view/Xpday/MailFormattingRules" rel="nofollow" onmouseover="this.href='mai' + 'lto:' + 'wiki2go' + '@' + 'nayima.be'">wiki2go</a>
|
525
|
+
</TD>
|
526
|
+
</TR>
|
527
|
+
<tr><td colspan="2"><hr></td></tr>
|
528
|
+
<tr>
|
529
|
+
<td><FORM action="/search/Xpday" method="post" id="search" name="search">
|
530
|
+
Search for <INPUT name="text" size="30" ID="Text1"> <input type="submit" name="Go" value="Go">
|
531
|
+
</FORM>
|
532
|
+
</td>
|
533
|
+
<td>
|
534
|
+
|
535
|
+
</td>
|
536
|
+
</tr>
|
537
|
+
</TABLE>
|
538
|
+
</td>
|
539
|
+
</tr>
|
540
|
+
</table>
|
541
|
+
<span style="float:right">
|
542
|
+
<a target="_blank" href="http://validator.w3.org/check?uri=http://localhost/view/Xpday/FrontPage">
|
543
|
+
<img border="0" src="/html/valid-html401.png" alt="Verify if layout is correct!" height="31" width="88"></a>
|
544
|
+
</span>
|
545
|
+
</BODY>
|
546
|
+
</HTML>
|
547
|
+
END_EXPECTED_DIFF
|
548
|
+
end
|
549
|
+
|
550
|
+
def expected_diff
|
551
|
+
return <<END_EXPECTED_DIFF
|
552
|
+
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
553
|
+
<HTML>
|
554
|
+
<HEAD>
|
555
|
+
<META http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
556
|
+
<META http-equiv="Pragma" content="no-cache">
|
557
|
+
<META name="Author" content="Pascal Van Cauwenberghe">
|
558
|
+
<META name="Keywords" content="ruby,wiki">
|
559
|
+
<LINK rel="stylesheet" href="/html/Xpday/style.css" type="text/css">
|
560
|
+
<LINK rel="alternate" type="application/rss+xml" title="RSS 2.0 feed" href="/html/Xpday/rss.xml">
|
561
|
+
<TITLE>
|
562
|
+
|
563
|
+
Xpday
|
564
|
+
-
|
565
|
+
|
566
|
+
FrontPage
|
567
|
+
</TITLE>
|
568
|
+
</HEAD>
|
569
|
+
<BODY>
|
570
|
+
<table id="container">
|
571
|
+
<tr>
|
572
|
+
<td colspan="2" id="header">
|
573
|
+
<TABLE border="0" cellpadding="0" cellspacing="0" width="95%" class="Header">
|
574
|
+
<TR>
|
575
|
+
<TD><h1><a href="/search/Xpday?text=FrontPage" rel="nofollow">FrontPage</a>
|
576
|
+
|
577
|
+
<a href="/view/Xpday/FrontPage">v.1</a>
|
578
|
+
|
579
|
+
</h1>
|
580
|
+
</TD>
|
581
|
+
<td align="right"><a href="/view/Xpday/FrontPage">Home</a></td>
|
582
|
+
</TR>
|
583
|
+
</TABLE>
|
584
|
+
</td>
|
585
|
+
</tr>
|
586
|
+
<tr>
|
587
|
+
<td id="menu" valign="top" nowrap>
|
588
|
+
|
589
|
+
<ul>
|
590
|
+
<li>
|
591
|
+
<a href="/versions/Xpday/FrontPage" rel="nofollow">Page History</a>
|
592
|
+
</li>
|
593
|
+
|
594
|
+
<li>
|
595
|
+
<a href="/sidebyside/Xpday/FrontPage?from=0&to=1" rel="nofollow">What changed?</a>
|
596
|
+
</li>
|
597
|
+
|
598
|
+
<li>
|
599
|
+
<a href="/diff/Xpday/FrontPage?from=0&to=1" rel="nofollow">Diff</a>
|
600
|
+
</li>
|
601
|
+
<li>
|
602
|
+
<a href="/wikiedit/Xpday/FrontPage" rel="nofollow">Edit this page</a>
|
603
|
+
</li>
|
604
|
+
|
605
|
+
</ul>
|
606
|
+
<hr>
|
607
|
+
|
608
|
+
<ul>
|
609
|
+
<li>
|
610
|
+
<a href="/changes/Xpday" rel="nofollow">Recent changes</a>
|
611
|
+
</li>
|
612
|
+
<li>
|
613
|
+
<a href="/html/Xpday/rss.xml"><img src="/html/rssLogo.png" width="36" height="14" border="0" alt="Keep up to date"></a>
|
614
|
+
</li>
|
615
|
+
</ul>
|
616
|
+
</td>
|
617
|
+
<td id="body" width="100%" valign="top">
|
618
|
+
<strong>FrontPage <a href="/view/Xpday/FrontPage?version=0">v0 (by goodgirl)</a> => <a href="/view/Xpday/FrontPage?version=1">v1 (by goodboy)</a> <a href="/diff/Xpday/FrontPage?from=0&to=2" rel="nofollow">>></a></strong>
|
619
|
+
<hr>
|
620
|
+
|
621
|
+
<div class="diff_kept">= start</div>
|
622
|
+
<div class="diff_kept">= edited by *good girl & boy*</div>
|
623
|
+
<div class="diff_deleted">< I want a pony!</div>
|
624
|
+
<div class="diff_added">> I hate ponies!</div>
|
625
|
+
</td>
|
626
|
+
</tr>
|
627
|
+
<tr>
|
628
|
+
<td colspan="2" id="footer">
|
629
|
+
<TABLE border="0" cellpadding="0" cellspacing="0" width="100%" class="Footer">
|
630
|
+
<TR>
|
631
|
+
<TD width="50%">
|
632
|
+
|
633
|
+
<a href="/sidebyside/Xpday/FrontPage?from=0&to=1" rel="nofollow">Changed</a>
|
634
|
+
on
|
635
|
+
DATE
|
636
|
+
by
|
637
|
+
<a href="/search/Xpday?text=goodboy" rel="nofollow">goodboy</a>
|
638
|
+
|
639
|
+
</TD>
|
640
|
+
<TD width="50%" align="right">
|
641
|
+
Contact the site administrator:
|
642
|
+
<a href="/view/Xpday/MailFormattingRules" rel="nofollow" onmouseover="this.href='mai' + 'lto:' + 'wiki2go' + '@' + 'nayima.be'">wiki2go</a>
|
643
|
+
</TD>
|
644
|
+
</TR>
|
645
|
+
<tr><td colspan="2"><hr></td></tr>
|
646
|
+
<tr>
|
647
|
+
<td><FORM action="/search/Xpday" method="post" id="search" name="search">
|
648
|
+
Search for <INPUT name="text" size="30" ID="Text1"> <input type="submit" name="Go" value="Go">
|
649
|
+
</FORM>
|
650
|
+
</td>
|
651
|
+
<td>
|
652
|
+
|
653
|
+
</td>
|
654
|
+
</tr>
|
655
|
+
</TABLE>
|
656
|
+
</td>
|
657
|
+
</tr>
|
658
|
+
</table>
|
659
|
+
<span style="float:right">
|
660
|
+
<a target="_blank" href="http://validator.w3.org/check?uri=http://localhost/view/Xpday/FrontPage">
|
661
|
+
<img border="0" src="/html/valid-html401.png" alt="Verify if layout is correct!" height="31" width="88"></a>
|
662
|
+
</span>
|
663
|
+
</BODY>
|
664
|
+
</HTML>
|
665
|
+
END_EXPECTED_DIFF
|
666
|
+
end
|
667
|
+
|
668
|
+
def expected_sidebyside
|
669
|
+
return <<END_EXPECTED_SIDEBYSIDE
|
670
|
+
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
671
|
+
<HTML>
|
672
|
+
<HEAD>
|
673
|
+
<META http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
674
|
+
<META http-equiv="Pragma" content="no-cache">
|
675
|
+
<META name="Author" content="Pascal Van Cauwenberghe">
|
676
|
+
<META name="Keywords" content="ruby,wiki">
|
677
|
+
<LINK rel="stylesheet" href="/html/Xpday/style.css" type="text/css">
|
678
|
+
<LINK rel="alternate" type="application/rss+xml" title="RSS 2.0 feed" href="/html/Xpday/rss.xml">
|
679
|
+
<TITLE>
|
680
|
+
|
681
|
+
Xpday
|
682
|
+
-
|
683
|
+
|
684
|
+
FrontPage
|
685
|
+
</TITLE>
|
686
|
+
</HEAD>
|
687
|
+
<BODY>
|
688
|
+
<table id="container">
|
689
|
+
<tr>
|
690
|
+
<td colspan="2" id="header">
|
691
|
+
<TABLE border="0" cellpadding="0" cellspacing="0" width="95%" class="Header">
|
692
|
+
<TR>
|
693
|
+
<TD><h1><a href="/search/Xpday?text=FrontPage" rel="nofollow">FrontPage</a>
|
694
|
+
|
695
|
+
<a href="/view/Xpday/FrontPage">v.1</a>
|
696
|
+
|
697
|
+
</h1>
|
698
|
+
</TD>
|
699
|
+
<td align="right"><a href="/view/Xpday/FrontPage">Home</a></td>
|
700
|
+
</TR>
|
701
|
+
</TABLE>
|
702
|
+
</td>
|
703
|
+
</tr>
|
704
|
+
<tr>
|
705
|
+
<td id="menu" valign="top" nowrap>
|
706
|
+
|
707
|
+
<ul>
|
708
|
+
<li>
|
709
|
+
<a href="/versions/Xpday/FrontPage" rel="nofollow">Page History</a>
|
710
|
+
</li>
|
711
|
+
|
712
|
+
<li>
|
713
|
+
<a href="/sidebyside/Xpday/FrontPage?from=0&to=1" rel="nofollow">What changed?</a>
|
714
|
+
</li>
|
715
|
+
|
716
|
+
<li>
|
717
|
+
<a href="/diff/Xpday/FrontPage?from=0&to=1" rel="nofollow">Diff</a>
|
718
|
+
</li>
|
719
|
+
<li>
|
720
|
+
<a href="/wikiedit/Xpday/FrontPage" rel="nofollow">Edit this page</a>
|
721
|
+
</li>
|
722
|
+
</ul>
|
723
|
+
<hr>
|
724
|
+
|
725
|
+
<ul>
|
726
|
+
<li>
|
727
|
+
<a href="/changes/Xpday" rel="nofollow">Recent changes</a>
|
728
|
+
</li>
|
729
|
+
<li>
|
730
|
+
<a href="/html/Xpday/rss.xml"><img src="/html/rssLogo.png" width="36" height="14" border="0" alt="Keep up to date"></a>
|
731
|
+
</li>
|
732
|
+
</ul>
|
733
|
+
</td>
|
734
|
+
<td id="body" width="100%" valign="top">
|
735
|
+
<table class="wikitable" width="100%"><tr><th><a href="/view/Xpday/FrontPage?version=0">FrontPage v0 (by goodgirl)</a></th><th><a href="/view/Xpday/FrontPage?version=1">FrontPage v1 (by goodboy)</a> <a href=\"/sidebyside/Xpday/FrontPage?from=0&to=2\" rel="nofollow">>></a></th></tr>
|
736
|
+
<tr><td width='50%' valign='top'>start<br>edited by <STRONG>good girl & boy</STRONG>
|
737
|
+
I want a pony!</td><td width='50%' valign='top'>start<br />edited by <STRONG>good girl & boy</STRONG>
|
738
|
+
I hate ponies!</td></tr></table>
|
739
|
+
</td>
|
740
|
+
</tr>
|
741
|
+
<tr>
|
742
|
+
<td colspan="2" id="footer">
|
743
|
+
<TABLE border="0" cellpadding="0" cellspacing="0" width="100%" class="Footer">
|
744
|
+
<TR>
|
745
|
+
<TD width="50%">
|
746
|
+
|
747
|
+
<a href="/sidebyside/Xpday/FrontPage?from=0&to=1" rel="nofollow">Changed</a>
|
748
|
+
on
|
749
|
+
DATE
|
750
|
+
by
|
751
|
+
<a href="/search/Xpday?text=goodboy" rel="nofollow">goodboy</a>
|
752
|
+
|
753
|
+
</TD>
|
754
|
+
<TD width="50%" align="right">
|
755
|
+
Contact the site administrator:
|
756
|
+
<a href="/view/Xpday/MailFormattingRules" rel="nofollow" onmouseover="this.href='mai' + 'lto:' + 'wiki2go' + '@' + 'nayima.be'">wiki2go</a>
|
757
|
+
</TD>
|
758
|
+
</TR>
|
759
|
+
<tr><td colspan="2"><hr></td></tr>
|
760
|
+
<tr>
|
761
|
+
<td><FORM action="/search/Xpday" method="post" id="search" name="search">
|
762
|
+
Search for <INPUT name="text" size="30" ID="Text1"> <input type="submit" name="Go" value="Go">
|
763
|
+
</FORM>
|
764
|
+
</td>
|
765
|
+
<td>
|
766
|
+
|
767
|
+
</td>
|
768
|
+
</tr>
|
769
|
+
</TABLE>
|
770
|
+
</td>
|
771
|
+
</tr>
|
772
|
+
</table>
|
773
|
+
<span style="float:right">
|
774
|
+
<a target="_blank" href="http://validator.w3.org/check?uri=http://localhost/view/Xpday/FrontPage">
|
775
|
+
<img border="0" src="/html/valid-html401.png" alt="Verify if layout is correct!" height="31" width="88"></a>
|
776
|
+
</span>
|
777
|
+
</BODY>
|
778
|
+
</HTML>
|
779
|
+
END_EXPECTED_SIDEBYSIDE
|
780
|
+
end
|
781
|
+
|
782
|
+
|
783
|
+
|
184
784
|
end
|