Wiki2Go 1.16.1 → 1.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/Web2Go/CGIRequest.rb +40 -8
- data/lib/Web2Go/MockRequest.rb +11 -2
- data/lib/Web2Go/WebrickRequest.rb +4 -0
- data/lib/Wiki2Go/DotGraphics.rb +1 -1
- data/lib/Wiki2Go/Install/config/chonqed_blacklist.txt +1537 -13
- data/lib/Wiki2Go/Install/config/mime.types.conf +49 -0
- data/lib/Wiki2Go/Install/config/passwords +1 -1
- data/lib/Wiki2Go/Install/make_repository.rb +3 -2
- data/lib/Wiki2Go/Install/make_site.rb +222 -19
- data/lib/Wiki2Go/Install/site/error.html +52 -52
- data/lib/Wiki2Go/Install/templates/admin_pages/commit_site.txt +5 -1
- data/lib/Wiki2Go/Install/templates/admin_pages/edit.txt +8 -2
- data/lib/Wiki2Go/Install/templates/admin_pages/editfiles.txt +52 -7
- data/lib/Wiki2Go/Install/templates/admin_pages/greylist.txt +6 -3
- data/lib/Wiki2Go/Install/templates/admin_pages/passwords.txt +5 -2
- data/lib/Wiki2Go/Install/templates/admin_pages/regenerate.txt +4 -1
- data/lib/Wiki2Go/Install/templates/admin_pages/removespam.txt +4 -1
- data/lib/Wiki2Go/Install/templates/admin_pages/show_log.txt +5 -1
- data/lib/Wiki2Go/Install/templates/admin_pages/update_blacklist.txt +4 -1
- data/lib/Wiki2Go/Install/templates/admin_pages/update_conflicts.txt +4 -1
- data/lib/Wiki2Go/Install/templates/admin_pages/update_site.txt +5 -1
- data/lib/Wiki2Go/Install/templates/full_footer.htm +2 -2
- data/lib/Wiki2Go/Install/templates/simple_footer.htm +1 -1
- data/lib/Wiki2Go/LineFormatter.rb +41 -31
- data/lib/Wiki2Go/Web.rb +1 -22
- data/lib/Wiki2Go/Wiki2GoServlet.rb +11 -4
- data/test/TestFormatter.rb +11 -11
- data/test/TestLineFormatter.rb +37 -37
- data/test/TestRepositoryMaker.rb +1 -1
- data/test/TestWeb.rb +3 -4
- data/test/TestWeb2Go.rb +5 -6
- data/test/TestWiki2GoServlet.rb +95 -74
- data/test/testdata/expected_edit.html +10 -10
- data/test/testdata/expected_out.html +22 -22
- data/test/testdata/expected_put.html +10 -10
- data/test/testdata/expected_save.html +11 -11
- data/test/testdata/expected_savehtml.html +11 -11
- data/test/testdata/expected_search.html +8 -8
- data/test/testdata/expected_upload.html +11 -11
- data/test/testdata/expected_view.html +22 -22
- metadata +3 -2
data/test/TestLineFormatter.rb
CHANGED
@@ -135,7 +135,7 @@ class TestLineFormatter < Test::Unit::TestCase
|
|
135
135
|
formatter = makeFormatter
|
136
136
|
|
137
137
|
formatted = formatter.format_line('Interesting site:http://www.toolshed.com/blog/SoftwareDevelopment/sustainable_pace.html,v')
|
138
|
-
assert_equal('Interesting site:<a href="redirect/Xpday?url=http%3A%2F%2Fwww.toolshed.com%2Fblog%2FSoftwareDevelopment%2Fsustainable_pace.html%2Cv" rel="nofollow" target="_blank">http://www.toolshed.com/blog/SoftwareDevelopment/sustainable_pace.html,v</a>',formatted)
|
138
|
+
assert_equal('Interesting site:<a href="/redirect/Xpday?url=http%3A%2F%2Fwww.toolshed.com%2Fblog%2FSoftwareDevelopment%2Fsustainable_pace.html%2Cv" rel="nofollow" target="_blank">http://www.toolshed.com/blog/SoftwareDevelopment/sustainable_pace.html,v</a>',formatted)
|
139
139
|
end
|
140
140
|
|
141
141
|
# Bug reported by Marc Evers: upercase file extensions are not recognized
|
@@ -150,32 +150,32 @@ class TestLineFormatter < Test::Unit::TestCase
|
|
150
150
|
formatter = makeFormatter
|
151
151
|
|
152
152
|
formatted = formatter.format_line(" a link http://wiki.xp.be works ")
|
153
|
-
assert_equal(" a link <a href=\"redirect/Xpday?url=http%3A%2F%2Fwiki.xp.be\" rel=\"nofollow\" target=\"_blank\">http://wiki.xp.be</a> works ",formatted)
|
153
|
+
assert_equal(" a link <a href=\"/redirect/Xpday?url=http%3A%2F%2Fwiki.xp.be\" rel=\"nofollow\" target=\"_blank\">http://wiki.xp.be</a> works ",formatted)
|
154
154
|
|
155
155
|
formatted = formatter.format_line(" a link http://www.xp.be/logo.gif works ")
|
156
156
|
assert_equal(" a link <img src=\"http://www.xp.be/logo.gif\" alt=\"logo\"> works ",formatted)
|
157
157
|
|
158
158
|
|
159
159
|
formatted = formatter.format_line(" a mail link mailto:pvc@nayima.be works ")
|
160
|
-
assert_equal(" a mail link <a href=\"view/Xpday/MailFormattingRules\" onmouseover=\"this.href='mai' + 'lto:' + 'pvc' + '@' + 'nayima.be'\">pvc</a> works ",formatted)
|
160
|
+
assert_equal(" a mail link <a href=\"/view/Xpday/MailFormattingRules\" onmouseover=\"this.href='mai' + 'lto:' + 'pvc' + '@' + 'nayima.be'\">pvc</a> works ",formatted)
|
161
161
|
|
162
162
|
formatted = formatter.format_line(" a link %test@http://SomePage% works ")
|
163
|
-
assert_equal(" a link <a href=\"redirect/Xpday?url=http%3A%2F%2FSomePage\" rel=\"nofollow\" target=\"_blank\">test</a> works ",formatted)
|
163
|
+
assert_equal(" a link <a href=\"/redirect/Xpday?url=http%3A%2F%2FSomePage\" rel=\"nofollow\" target=\"_blank\">test</a> works ",formatted)
|
164
164
|
|
165
165
|
formatted = formatter.format_line(" a link {test@http://SomePage} works ")
|
166
|
-
assert_equal(" a link <a href=\"redirect/Xpday?url=http%3A%2F%2FSomePage\" rel=\"nofollow\" target=\"_blank\">test</a> works ",formatted)
|
166
|
+
assert_equal(" a link <a href=\"/redirect/Xpday?url=http%3A%2F%2FSomePage\" rel=\"nofollow\" target=\"_blank\">test</a> works ",formatted)
|
167
167
|
|
168
168
|
formatted = formatter.format_line(" a link <a href=\"http://SomePage?id=1\">test</a> works ")
|
169
|
-
assert_equal(" a link <a href=\"redirect/Xpday?url=http%3A%2F%2FSomePage%3Fid%3D1\" rel=\"nofollow\" target=\"_blank\">test</a> works ",formatted)
|
169
|
+
assert_equal(" a link <a href=\"/redirect/Xpday?url=http%3A%2F%2FSomePage%3Fid%3D1\" rel=\"nofollow\" target=\"_blank\">test</a> works ",formatted)
|
170
170
|
|
171
171
|
formatted = formatter.format_line(" a link {test@http://www.belgium.be/eportal/application?origin=charterHome.jsp&event=bea.portal.framework.internal.refresh&pageid=charterDetailPage&navId=3647} works ")
|
172
|
-
assert_equal(" a link <a href=\"redirect/Xpday?url=http%3A%2F%2Fwww.belgium.be%2Feportal%2Fapplication%3Forigin%3DcharterHome.jsp%26event%3Dbea.portal.framework.internal.refresh%26pageid%3DcharterDetailPage%26navId%3D3647\" rel=\"nofollow\" target=\"_blank\">test</a> works ",formatted)
|
172
|
+
assert_equal(" a link <a href=\"/redirect/Xpday?url=http%3A%2F%2Fwww.belgium.be%2Feportal%2Fapplication%3Forigin%3DcharterHome.jsp%26event%3Dbea.portal.framework.internal.refresh%26pageid%3DcharterDetailPage%26navId%3D3647\" rel=\"nofollow\" target=\"_blank\">test</a> works ",formatted)
|
173
173
|
|
174
174
|
formatted = formatter.format_line("http://home.scarlet.be/~ridesmet/")
|
175
|
-
assert_equal("<a href=\"redirect/Xpday?url=http%3A%2F%2Fhome.scarlet.be%2F%7Eridesmet%2F\" rel=\"nofollow\" target=\"_blank\">http://home.scarlet.be/~ridesmet/</a>",formatted)
|
175
|
+
assert_equal("<a href=\"/redirect/Xpday?url=http%3A%2F%2Fhome.scarlet.be%2F%7Eridesmet%2F\" rel=\"nofollow\" target=\"_blank\">http://home.scarlet.be/~ridesmet/</a>",formatted)
|
176
176
|
|
177
177
|
formatted = formatter.format_line(" a link (http://wiki.xp.be) works ")
|
178
|
-
assert_equal(" a link (<a href=\"redirect/Xpday?url=http%3A%2F%2Fwiki.xp.be\" rel=\"nofollow\" target=\"_blank\">http://wiki.xp.be</a>) works ",formatted)
|
178
|
+
assert_equal(" a link (<a href=\"/redirect/Xpday?url=http%3A%2F%2Fwiki.xp.be\" rel=\"nofollow\" target=\"_blank\">http://wiki.xp.be</a>) works ",formatted)
|
179
179
|
|
180
180
|
end
|
181
181
|
|
@@ -189,7 +189,7 @@ class TestLineFormatter < Test::Unit::TestCase
|
|
189
189
|
assert_equal(" a link <img src=\"http://www.xp.be/logo.gif\" alt=\"logo\"> works ",formatted)
|
190
190
|
|
191
191
|
formatted = formatter.format_line(" a mail link mailto:pvc@nayima.be works ")
|
192
|
-
assert_equal(" a mail link <a href=\"Xpday/MailFormattingRules.html\" onmouseover=\"this.href='mai' + 'lto:' + 'pvc' + '@' + 'nayima.be'\">pvc</a> works ",formatted)
|
192
|
+
assert_equal(" a mail link <a href=\"/Xpday/MailFormattingRules.html\" onmouseover=\"this.href='mai' + 'lto:' + 'pvc' + '@' + 'nayima.be'\">pvc</a> works ",formatted)
|
193
193
|
|
194
194
|
formatted = formatter.format_line(" a link %test@http://SomePage% works ")
|
195
195
|
assert_equal(" a link <a href=\"http://SomePage\" target=\"_blank\">test</a> works ",formatted)
|
@@ -264,36 +264,36 @@ class TestLineFormatter < Test::Unit::TestCase
|
|
264
264
|
def test_local_resources
|
265
265
|
formatter = makePublicFormatter
|
266
266
|
formatted = formatter.format_line("{microsoft.gif}")
|
267
|
-
assert_equal("<img src=\"html/Xpday/microsoft.gif\" border=0 alt=\"microsoft\" >",formatted)
|
267
|
+
assert_equal("<img src=\"/html/Xpday/microsoft.gif\" border=0 alt=\"microsoft\" >",formatted)
|
268
268
|
|
269
269
|
formatted = formatter.format_line("{paper.pdf}")
|
270
|
-
assert_equal("<a href=\"html/Xpday/paper.pdf\" target=\"_blank\">paper.pdf</a>",formatted)
|
270
|
+
assert_equal("<a href=\"/html/Xpday/paper.pdf\" target=\"_blank\">paper.pdf</a>",formatted)
|
271
271
|
|
272
272
|
formatted = formatter.format_line("{The Evil Empire@microsoft.gif}")
|
273
|
-
assert_equal("<img src=\"html/Xpday/microsoft.gif\" border=0 alt=\"The Evil Empire\" >",formatted)
|
273
|
+
assert_equal("<img src=\"/html/Xpday/microsoft.gif\" border=0 alt=\"The Evil Empire\" >",formatted)
|
274
274
|
|
275
275
|
formatted = formatter.format_line("{A very interesting text@paper.pdf}")
|
276
|
-
assert_equal("<a href=\"html/Xpday/paper.pdf\" target=\"_blank\">A very interesting text</a>",formatted)
|
276
|
+
assert_equal("<a href=\"/html/Xpday/paper.pdf\" target=\"_blank\">A very interesting text</a>",formatted)
|
277
277
|
|
278
278
|
formatted = formatter.format_line("{http://microsoft.com@microsoft.gif}")
|
279
|
-
assert_equal("<a href=\"http://microsoft.com\" target=\"_blank\"><img src=\"html/Xpday/microsoft.gif\" border=0 alt=\"microsoft\" ></a>",formatted)
|
279
|
+
assert_equal("<a href=\"http://microsoft.com\" target=\"_blank\"><img src=\"/html/Xpday/microsoft.gif\" border=0 alt=\"microsoft\" ></a>",formatted)
|
280
280
|
|
281
281
|
formatted = formatter.format_line("{WS07_XP2005.WhenTeamworkIsntWorking.pdf}")
|
282
|
-
assert_equal("<a href=\"html/Xpday/WS07_XP2005.WhenTeamworkIsntWorking.pdf\" target=\"_blank\">WS07_XP2005.WhenTeamworkIsntWorking.pdf</a>",formatted)
|
282
|
+
assert_equal("<a href=\"/html/Xpday/WS07_XP2005.WhenTeamworkIsntWorking.pdf\" target=\"_blank\">WS07_XP2005.WhenTeamworkIsntWorking.pdf</a>",formatted)
|
283
283
|
|
284
284
|
formatted = formatter.resource_url("style.css")
|
285
|
-
assert_equal("html/Xpday/style.css",formatted)
|
285
|
+
assert_equal("/html/Xpday/style.css",formatted)
|
286
286
|
|
287
287
|
formatter = make_single_wiki_Formatter
|
288
288
|
|
289
289
|
formatted = formatter.resource_url("style.css")
|
290
|
-
assert_equal("html/style.css",formatted)
|
290
|
+
assert_equal("/html/style.css",formatted)
|
291
291
|
|
292
292
|
formatted = formatter.format_line("{http://microsoft.com@microsoft.gif}")
|
293
|
-
assert_equal("<a href=\"http://microsoft.com\" target=\"_blank\"><img src=\"html/microsoft.gif\" border=0 alt=\"microsoft\" ></a>",formatted)
|
293
|
+
assert_equal("<a href=\"http://microsoft.com\" target=\"_blank\"><img src=\"/html/microsoft.gif\" border=0 alt=\"microsoft\" ></a>",formatted)
|
294
294
|
|
295
295
|
formatted = formatter.format_line("{Registratie@registration.html}")
|
296
|
-
assert_equal('<a href="html/registration.html">Registratie</a>',formatted)
|
296
|
+
assert_equal('<a href="/html/registration.html">Registratie</a>',formatted)
|
297
297
|
|
298
298
|
end
|
299
299
|
|
@@ -306,41 +306,41 @@ class TestLineFormatter < Test::Unit::TestCase
|
|
306
306
|
def test_underscore_in_url
|
307
307
|
formatter = makeFormatter
|
308
308
|
formatted = formatter.format_line("<p align=center>{http://www.agileopen.com@agileopen_logo.jpg}</p>")
|
309
|
-
assert_equal('<p align=center><a href="redirect/Xpday?url=http%3A%2F%2Fwww.agileopen.com" rel="nofollow" target="_blank"><img src="html/Xpday/agileopen_logo.jpg" border=0 alt="agileopen_logo" ></a></p>',formatted)
|
309
|
+
assert_equal('<p align=center><a href="/redirect/Xpday?url=http%3A%2F%2Fwww.agileopen.com" rel="nofollow" target="_blank"><img src="/html/Xpday/agileopen_logo.jpg" border=0 alt="agileopen_logo" ></a></p>',formatted)
|
310
310
|
end
|
311
311
|
|
312
312
|
def test_pages
|
313
313
|
formatter = makeFormatter
|
314
314
|
|
315
315
|
formatted = formatter.format_line(" a SomeLink AnotherLink Nolink ")
|
316
|
-
assert_equal(" a <a href=\"view/Xpday/SomeLink\">SomeLink</a> <a href=\"view/Xpday/AnotherLink\">AnotherLink</a> Nolink ",formatted)
|
316
|
+
assert_equal(" a <a href=\"/view/Xpday/SomeLink\">SomeLink</a> <a href=\"/view/Xpday/AnotherLink\">AnotherLink</a> Nolink ",formatted)
|
317
317
|
|
318
318
|
formatted = formatter.format_line("SomeLink or other")
|
319
|
-
assert_equal("<a href=\"view/Xpday/SomeLink\">SomeLink</a> or other",formatted)
|
319
|
+
assert_equal("<a href=\"/view/Xpday/SomeLink\">SomeLink</a> or other",formatted)
|
320
320
|
|
321
321
|
formatted = formatter.format_line(" a %Xpday2004:SomeLink% AnotherLink Nolink ")
|
322
|
-
assert_equal(" a <a href=\"view/Xpday2004/SomeLink\">Xpday2004:SomeLink</a> <a href=\"view/Xpday/AnotherLink\">AnotherLink</a> Nolink ",formatted)
|
322
|
+
assert_equal(" a <a href=\"/view/Xpday2004/SomeLink\">Xpday2004:SomeLink</a> <a href=\"/view/Xpday/AnotherLink\">AnotherLink</a> Nolink ",formatted)
|
323
323
|
|
324
324
|
formatted = formatter.format_line(" a {Xpday2004:SomeLink} AnotherLink Nolink ")
|
325
|
-
assert_equal(" a <a href=\"view/Xpday2004/SomeLink\">Xpday2004:SomeLink</a> <a href=\"view/Xpday/AnotherLink\">AnotherLink</a> Nolink ",formatted)
|
325
|
+
assert_equal(" a <a href=\"/view/Xpday2004/SomeLink\">Xpday2004:SomeLink</a> <a href=\"/view/Xpday/AnotherLink\">AnotherLink</a> Nolink ",formatted)
|
326
326
|
|
327
327
|
formatted = formatter.format_line(" a %a link@SomeLink% AnotherLink Nolink ")
|
328
|
-
assert_equal(" a <a href=\"view/Xpday/SomeLink\">a link</a> <a href=\"view/Xpday/AnotherLink\">AnotherLink</a> Nolink ",formatted)
|
328
|
+
assert_equal(" a <a href=\"/view/Xpday/SomeLink\">a link</a> <a href=\"/view/Xpday/AnotherLink\">AnotherLink</a> Nolink ",formatted)
|
329
329
|
|
330
330
|
formatted = formatter.format_line(" a {a link@SomeLink} AnotherLink Nolink ")
|
331
|
-
assert_equal(" a <a href=\"view/Xpday/SomeLink\">a link</a> <a href=\"view/Xpday/AnotherLink\">AnotherLink</a> Nolink ",formatted)
|
331
|
+
assert_equal(" a <a href=\"/view/Xpday/SomeLink\">a link</a> <a href=\"/view/Xpday/AnotherLink\">AnotherLink</a> Nolink ",formatted)
|
332
332
|
|
333
333
|
formatted = formatter.format_line(" a %alink% AnotherLink Nolink ")
|
334
|
-
assert_equal(" a <a href=\"view/Xpday/alink\">alink</a> <a href=\"view/Xpday/AnotherLink\">AnotherLink</a> Nolink ",formatted)
|
334
|
+
assert_equal(" a <a href=\"/view/Xpday/alink\">alink</a> <a href=\"/view/Xpday/AnotherLink\">AnotherLink</a> Nolink ",formatted)
|
335
335
|
|
336
336
|
formatted = formatter.format_line(" a {alink} AnotherLink Nolink ")
|
337
|
-
assert_equal(" a <a href=\"view/Xpday/alink\">alink</a> <a href=\"view/Xpday/AnotherLink\">AnotherLink</a> Nolink ",formatted)
|
337
|
+
assert_equal(" a <a href=\"/view/Xpday/alink\">alink</a> <a href=\"/view/Xpday/AnotherLink\">AnotherLink</a> Nolink ",formatted)
|
338
338
|
|
339
339
|
formatted = formatter.format_line(" a {AnotherLink} ")
|
340
|
-
assert_equal(" a <a href=\"view/Xpday/AnotherLink\">AnotherLink</a> ",formatted)
|
340
|
+
assert_equal(" a <a href=\"/view/Xpday/AnotherLink\">AnotherLink</a> ",formatted)
|
341
341
|
|
342
342
|
formatted = formatter.format_line(" a Wiki2GoStories ")
|
343
|
-
assert_equal(" a <a href=\"view/Xpday/Wiki2GoStories\">Wiki2GoStories</a> ",formatted)
|
343
|
+
assert_equal(" a <a href=\"/view/Xpday/Wiki2GoStories\">Wiki2GoStories</a> ",formatted)
|
344
344
|
|
345
345
|
end
|
346
346
|
|
@@ -348,10 +348,10 @@ class TestLineFormatter < Test::Unit::TestCase
|
|
348
348
|
formatter = makeFormatter
|
349
349
|
|
350
350
|
formatted = formatter.format_line("a {Subtopic/SubPage} ")
|
351
|
-
assert_equal("a <a href=\"view/Xpday/Subtopic/SubPage\">Subtopic/SubPage</a> ",formatted)
|
351
|
+
assert_equal("a <a href=\"/view/Xpday/Subtopic/SubPage\">Subtopic/SubPage</a> ",formatted)
|
352
352
|
|
353
353
|
formatted = formatter.format_line("a {subpage@Subtopic/SubPage} ")
|
354
|
-
assert_equal("a <a href=\"view/Xpday/Subtopic/SubPage\">subpage</a> ",formatted)
|
354
|
+
assert_equal("a <a href=\"/view/Xpday/Subtopic/SubPage\">subpage</a> ",formatted)
|
355
355
|
|
356
356
|
end
|
357
357
|
|
@@ -361,11 +361,11 @@ class TestLineFormatter < Test::Unit::TestCase
|
|
361
361
|
|
362
362
|
storage.find_it = true
|
363
363
|
formatted = formatter.format_line(" a SomeLink ")
|
364
|
-
assert_equal(" a <a href=\"view/Xpday/SomeLink\">SomeLink</a> ",formatted)
|
364
|
+
assert_equal(" a <a href=\"/view/Xpday/SomeLink\">SomeLink</a> ",formatted)
|
365
365
|
|
366
366
|
storage.find_it = false
|
367
367
|
formatted = formatter.format_line(" a SomeLink ")
|
368
|
-
assert_equal(" a SomeLink<a href=\"edit/Xpday/SomeLink\">?</a> ",formatted)
|
368
|
+
assert_equal(" a SomeLink<a href=\"/edit/Xpday/SomeLink\">?</a> ",formatted)
|
369
369
|
|
370
370
|
end
|
371
371
|
|
@@ -505,9 +505,9 @@ class TestLineFormatter < Test::Unit::TestCase
|
|
505
505
|
def test_dynamic_page_link
|
506
506
|
formatter = makeFormatter
|
507
507
|
formatted = formatter.format_line('{FrontPage.rbl}')
|
508
|
-
assert_equal('<a href="view/Xpday/FrontPage.rbl">FrontPage</a>',formatted)
|
508
|
+
assert_equal('<a href="/view/Xpday/FrontPage.rbl">FrontPage</a>',formatted)
|
509
509
|
formatted = formatter.format_line('{The dynamic page@FrontPage.rbl}')
|
510
|
-
assert_equal('<a href="view/Xpday/FrontPage.rbl">The dynamic page</a>',formatted)
|
510
|
+
assert_equal('<a href="/view/Xpday/FrontPage.rbl">The dynamic page</a>',formatted)
|
511
511
|
end
|
512
512
|
|
513
513
|
|
data/test/TestRepositoryMaker.rb
CHANGED
@@ -60,7 +60,7 @@ class TestRepositoryMaker < Test::Unit::TestCase
|
|
60
60
|
maker.add_wiki(site,'test','Commit initial site')
|
61
61
|
FileUtils::rm_r File.join(site,'texts','test.txt')
|
62
62
|
updated,clashed = maker.update(site,'test')
|
63
|
-
puts updated
|
63
|
+
# puts updated
|
64
64
|
assert_equal 1,updated.length
|
65
65
|
assert_equal 0,clashed.length
|
66
66
|
|
data/test/TestWeb.rb
CHANGED
@@ -185,13 +185,12 @@ class TestWeb < Test::Unit::TestCase
|
|
185
185
|
assert_equal("Xpbe",web.name)
|
186
186
|
assert_equal("PairProgramming/Parties",web.current_page)
|
187
187
|
assert_equal("Xpbe/PairProgramming/Parties",web.path)
|
188
|
-
assert_equal("http://wiki.xp.be/
|
188
|
+
assert_equal("http://wiki.xp.be/",web.base_url)
|
189
|
+
assert_equal('sub_site',web.subsite)
|
189
190
|
end
|
190
191
|
|
191
192
|
end
|
192
193
|
|
193
194
|
|
194
|
-
|
195
|
-
RUNIT::CUI::TestRunner.run(TestWeb.suite)
|
196
|
-
end
|
195
|
+
|
197
196
|
|
data/test/TestWeb2Go.rb
CHANGED
@@ -69,12 +69,11 @@ END_EXPECTED
|
|
69
69
|
def test_mock_request
|
70
70
|
|
71
71
|
request = Web2Go::MockRequest.new('http://localhost/view/user?id=5&detail=full',{ 'ENV_PARAM' => 'hello'})
|
72
|
-
assert_equal('localhost',request.
|
73
|
-
assert_equal(80,request.
|
74
|
-
assert_equal('view',request.
|
75
|
-
assert_equal('user',request.
|
76
|
-
assert_equal('
|
77
|
-
assert_equal('id=5&detail=full',request.server_variable['QUERY_STRING'])
|
72
|
+
assert_equal('localhost',request.host)
|
73
|
+
assert_equal(80,request.port)
|
74
|
+
assert_equal('view',request.script_name)
|
75
|
+
assert_equal('user',request.path)
|
76
|
+
assert_equal('id=5&detail=full',request.query_string)
|
78
77
|
|
79
78
|
assert_equal(['5'],request.params['id'])
|
80
79
|
assert_equal(['full'],request.params['detail'])
|