impostor 0.0.1

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.
Files changed (53) hide show
  1. data/History.txt +4 -0
  2. data/Manifest.txt +50 -0
  3. data/README.txt +65 -0
  4. data/Rakefile +40 -0
  5. data/lib/impostor.rb +6 -0
  6. data/lib/www/impostor/phpbb2.rb +260 -0
  7. data/lib/www/impostor/wwf79.rb +254 -0
  8. data/lib/www/impostor/wwf80.rb +264 -0
  9. data/lib/www/impostor.rb +269 -0
  10. data/test/fixtures/phpbb2-get-new_topic-form-good-response.html +725 -0
  11. data/test/fixtures/phpbb2-get-viewtopic-for-new-topic-good-response.html +364 -0
  12. data/test/fixtures/phpbb2-get-viewtopic-for-new-topic-malformed-response.html +364 -0
  13. data/test/fixtures/phpbb2-index.html +361 -0
  14. data/test/fixtures/phpbb2-logged-in.html +349 -0
  15. data/test/fixtures/phpbb2-login.html +306 -0
  16. data/test/fixtures/phpbb2-not-logged-in.html +349 -0
  17. data/test/fixtures/phpbb2-post-new_topic-good-response.html +290 -0
  18. data/test/fixtures/phpbb2-post-reply-good-response.html +290 -0
  19. data/test/fixtures/phpbb2-post-reply-throttled-response.html +290 -0
  20. data/test/fixtures/phpbb2-too-many-posts.html +290 -0
  21. data/test/fixtures/wwf79-forum_posts.html +422 -0
  22. data/test/fixtures/wwf79-general-new-topic-error.html +46 -0
  23. data/test/fixtures/wwf79-general-posting-error.html +46 -0
  24. data/test/fixtures/wwf79-good-post-forum_posts.html +462 -0
  25. data/test/fixtures/wwf79-index.html +137 -0
  26. data/test/fixtures/wwf79-logged-in.html +46 -0
  27. data/test/fixtures/wwf79-login.html +123 -0
  28. data/test/fixtures/wwf79-new-topic-forum_posts-response.html +305 -0
  29. data/test/fixtures/wwf79-new-topic-post_message_form.html +212 -0
  30. data/test/fixtures/wwf79-not-logged-in.html +128 -0
  31. data/test/fixtures/wwf79-too-many-posts.html +46 -0
  32. data/test/fixtures/wwf79-too-many-topics.html +46 -0
  33. data/test/fixtures/wwf80-general-posting-error.html +54 -0
  34. data/test/fixtures/wwf80-get-new_topic-form-good-response.html +217 -0
  35. data/test/fixtures/wwf80-get-viewtopic-for-new-topic-good-response.html +290 -0
  36. data/test/fixtures/wwf80-index.html +371 -0
  37. data/test/fixtures/wwf80-logged-in.html +52 -0
  38. data/test/fixtures/wwf80-login.html +125 -0
  39. data/test/fixtures/wwf80-new_reply_form.html +204 -0
  40. data/test/fixtures/wwf80-not-logged-in.html +136 -0
  41. data/test/fixtures/wwf80-post-new_topic-good-response.html +293 -0
  42. data/test/fixtures/wwf80-post-reply-good-response.html +331 -0
  43. data/test/fixtures/wwf80-too-many-posts.html +54 -0
  44. data/test/test_helper.rb +38 -0
  45. data/test/test_www_impostor.rb +165 -0
  46. data/test/test_www_impostor_phpbb2.rb +536 -0
  47. data/test/test_www_impostor_wwf79.rb +535 -0
  48. data/test/test_www_impostor_wwf80.rb +535 -0
  49. data/vendor/plugins/impostor/lib/autotest/discover.rb +3 -0
  50. data/vendor/plugins/impostor/lib/autotest/impostor.rb +49 -0
  51. data.tar.gz.sig +3 -0
  52. metadata +156 -0
  53. metadata.gz.sig +3 -0
@@ -0,0 +1,331 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2
+ <html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en"><head>
3
+
4
+
5
+
6
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><title>OMLB Forums: euro bot</title>
7
+
8
+ <meta name="generator" content="Web Wiz Forums"><!--//
9
+ /* *******************************************************
10
+ Application: Web Wiz Forums ver. 8.05a
11
+ Info: http://www.webwizforums.com
12
+ Copyright: 2001-2006 Web Wiz. All rights reserved
13
+ ******************************************************* */
14
+ //-->
15
+
16
+
17
+
18
+ <link rel="alternate" type="application/rss+xml" title="RSS 2.0" href="http://omlb.com/forum/RSS_post_feed.asp?TID=5002">
19
+
20
+ <script language="JavaScript">
21
+ function chgOrder(Show){
22
+
23
+ strShow = escape(Show.options[Show.selectedIndex].value);
24
+
25
+ if (Show != '') self.location.href = 'forum_posts.asp?TID=5002&PD=' + strShow + '';
26
+ return true;
27
+ }
28
+
29
+ function CheckForm() {
30
+ var errorMsg = '';
31
+ var formArea = document.getElementById('frmMessageForm');
32
+
33
+ //For Gecko Madis API (RTE)
34
+ if (formArea.message.value.indexOf('<br>') > -1 && formArea.message.value.length==5) formArea.message.value = '';
35
+
36
+
37
+ //Check for message
38
+ if (formArea.message.value==''){
39
+ errorMsg += '\n\tMessage Box \t\t- Enter a Message to Submit';
40
+ }
41
+
42
+ //If there is aproblem with the form then display an error
43
+ if (errorMsg != ''){
44
+ msg = '_______________________________________________________________\n\n';
45
+ msg += 'The form has not been submitted because there are problem(s) with the form.\n';
46
+ msg += 'Please correct the problem(s) and re-submit the form.\n';
47
+ msg += '_______________________________________________________________\n\n';
48
+ msg += 'The following field(s) need to be corrected: -\n';
49
+
50
+ errorMsg += alert(msg + errorMsg + '\n\n');
51
+ return false;
52
+ }
53
+
54
+ return true;
55
+ }
56
+ </script>
57
+ <link href="forum_posts.asp_files/default_style.css" rel="stylesheet" type="text/css">
58
+ <script language="javascript" src="forum_posts.asp_files/default_javascript.js" type="text/javascript"></script><style type="text/css">@import url(http://hoodwink.d/themes/1/hoodwinkd.css);</style><style type="text/css"></style></head><body>
59
+ <table class="basicTable" align="center" cellpadding="3" cellspacing="0">
60
+ <tbody><tr>
61
+ <td rowspan="2"><a href="http://www.omlb.com/html/olmb.htm" accesskey="1"><img src="forum_posts.asp_files/logo.gif" border="0"></a></td>
62
+ <td align="center">&nbsp;&nbsp;<a href="http://omlb.com/forum/active_topics.asp" class="nav" accesskey="2"><img src="forum_posts.asp_files/active_topics.gif" alt="Active Topics" align="absmiddle" border="0">Active Topics</a>&nbsp;&nbsp;<a href="http://omlb.com/forum/members.asp" class="nav"><img src="forum_posts.asp_files/members_list.gif" alt="Display List of Forum Members" align="absmiddle" border="0">Memberlist</a>&nbsp;&nbsp;<a href="http://omlb.com/forum/calendar.asp" class="nav"><img src="forum_posts.asp_files/calendar.gif" alt="Calendar" align="absmiddle" border="0">Calendar</a>&nbsp;&nbsp;<a href="http://omlb.com/forum/search_form.asp?FID=37" class="nav" accesskey="4"><img src="forum_posts.asp_files/search.gif" alt="Search The Forum" align="absmiddle" border="0">Search</a>&nbsp;&nbsp;<a href="http://omlb.com/forum/help.asp" class="nav" accesskey="5"><img src="forum_posts.asp_files/help_icon.gif" alt="Help" align="absmiddle" border="0">Help</a></td>
63
+ </tr>
64
+ <tr>
65
+ <td align="center"><a href="http://omlb.com/forum/pm_welcome.asp" class="nav"><img src="forum_posts.asp_files/read_private_message_icon.gif" alt="Read" message="" align="absmiddle" border="0">Private Messenger</a>&nbsp;&nbsp;<a href="http://omlb.com/forum/member_control_panel.asp" class="nav"><img src="forum_posts.asp_files/admin_icon.gif" alt="Member Control Panel Menu" align="absmiddle" border="0">Settings</a>&nbsp;&nbsp;<a href="http://omlb.com/forum/log_off_user.asp" class="nav"><img src="forum_posts.asp_files/log_off_icon.gif" alt="Logout" align="absmiddle" border="0">Logout [tester]</a></td>
66
+ </tr>
67
+ </tbody></table>
68
+ <div style="margin: 5px;" align="center"></div>
69
+ <a name="top"></a>
70
+ <table class="basicTable" align="center" cellpadding="3" cellspacing="0">
71
+ <tbody><tr>
72
+ <td class="heading">Cellphoto bot</td>
73
+ </tr>
74
+ <tr>
75
+ <td><strong><img src="forum_posts.asp_files/open_folder_icon.gif" align="absmiddle" border="0">&nbsp;<a href="http://omlb.com/forum/default.asp"><strong>OMLB Forums</strong></a> : <a href="http://omlb.com/forum/default.asp?C=2"><strong>The Shit Pit </strong></a> : <a href="http://omlb.com/forum/forum_topics.asp?FID=37"><strong>Cellphoto bot</strong></a></strong></td>
76
+ <td align="right" nowrap="nowrap" width="5%"><a href="http://omlb.com/forum/RSS_post_feed.asp?TID=5002" target="_blank"><img src="forum_posts.asp_files/rss.png" title="RSS Feed: euro bot" align="absmiddle" border="0"></a>&nbsp;</td>
77
+ </tr>
78
+ </tbody></table>
79
+ <table class="basicTable" align="center" cellpadding="3" cellspacing="0">
80
+ <tbody><tr>
81
+ <td width="70%"> <img src="forum_posts.asp_files/topic_icon.gif" alt="Message Icon" align="absmiddle" border="0"> <span class="lgText">Topic: euro bot</span></td>
82
+ <td align="right" nowrap="nowrap"><a href="http://omlb.com/forum/new_reply_form.asp?TID=5002&amp;PN=1&amp;TR=2"><img src="forum_posts.asp_files/post_reply.gif" alt="Post Reply" align="absmiddle" border="0"></a> <a href="http://omlb.com/forum/new_topic_form.asp?FID=37"><img src="forum_posts.asp_files/new_post.gif" alt="Post New Topic" align="absmiddle" border="0"></a> </td>
83
+ </tr>
84
+ <tr>
85
+ <td>
86
+ <select name="PD" id="PD" onchange="chgOrder(this)">
87
+ <option value="1" selected="selected">Oldest Post First</option>
88
+ <option value="0">Newest Post First</option>
89
+ </select>
90
+ </td>
91
+ <td align="right"></td>
92
+ </tr>
93
+ </tbody></table>
94
+ <table class="tableBorder" style="table-layout: fixed;" align="center" cellpadding="3" cellspacing="1">
95
+ <tbody><tr class="tableLedger">
96
+ <td style="width: 140px;" align="center">Author</td>
97
+ <td align="center">Message</td>
98
+ </tr>
99
+ <tr>
100
+ <td rowspan="5" class="msgEvenTableSide" valign="top">
101
+ <a name="101899"></a>
102
+ <a href="http://omlb.com/forum/member_profile.asp?PF=81&amp;FID=37">jani</a>
103
+ <br> fruitbootshoeplanker
104
+ <br><img src="forum_posts.asp_files/5_star_rating.gif" alt=" fruitbootshoeplanker">
105
+ <br><img src="forum_posts.asp_files/20070914_110830_classic1.jpg" alt="Avatar" class="avatar" onerror="this.src='avatars/blank_avatar.jpg';">
106
+ <br>i love chickens
107
+ <br><br>Joined: April&nbsp;11&nbsp;2004
108
+ <br>Location: Latvia
109
+ <br>Online Status: Offline
110
+ <br>Posts: 1339
111
+ <br>
112
+ </td>
113
+ <td class="msgEvenTableRow" valign="top"><span style="float: right;"><a href="http://omlb.com/forum/new_reply_form.asp?M=Q&amp;PID=101899&amp;PN=1&amp;TR=2"><img src="forum_posts.asp_files/quote_icon.gif" alt="Quote&nbsp;jani" align="absmiddle" border="0"></a>&nbsp;<a href="http://omlb.com/forum/new_reply_form.asp?PID=101899&amp;PN=1&amp;TR=2"><img src="forum_posts.asp_files/reply.gif" alt="Reply" align="absmiddle" border="0"></a></span><a href="http://omlb.com/forum/forum_posts.asp?TID=5002&amp;PID=101899#101899" alt="Direct Link To This Post"><img src="forum_posts.asp_files/bullet.gif" alt="bullet" align="absmiddle" border="0"></a> <strong>Topic: euro bot</strong><br>&nbsp;&nbsp;&nbsp;&nbsp;Posted: September&nbsp;19&nbsp;2007 at 8:37pm</td>
114
+ </tr>
115
+ <tr class="msgEvenTableRow">
116
+ <td class="msgLineDevider" height="150" valign="top">
117
+ <!-- Start Member Post -->
118
+ <div class="msgBody" style="overflow: auto; float: left;">
119
+ hey where the fuck is the bot?
120
+ </div>
121
+ <!-- End Member Post -->
122
+ </td>
123
+ </tr>
124
+ <tr class="msgEvenTableRow">
125
+ <td class="msgLineDevider" style="border-top-width: 0px;">
126
+ <!-- Start Signature -->
127
+ <div class="msgSignature" style="overflow: auto; float: left;">
128
+ <a href="http://www.last.fm/user/janizoom/?chartstyle=basicrt10" target="_blank"> <img src="forum_posts.asp_files/janizoom.gif" border="0"> </a>
129
+ </div>
130
+ <!-- End Signature "'' -->
131
+ </td>
132
+ </tr>
133
+ <tr class="msgEvenTableRow">
134
+ <td class="msgLineDevider" style="border-top-width: 0px;" align="center"><div align="center"></div>
135
+ </td>
136
+ </tr>
137
+ <tr class="msgEvenTableRow">
138
+ <td nowrap="nowrap">
139
+ <span style="float: right;"><img src="forum_posts.asp_files/ip.gif" alt="IP" align="absmiddle" border="0"> IP Logged</span></td>
140
+ </tr>
141
+ <tr class="postSeparatorTableRow">
142
+ <td colspan="2"></td>
143
+ </tr>
144
+ <tr>
145
+ <td rowspan="4" class="msgOddTableSide" valign="top">
146
+ <a name="102966"></a>
147
+ <a href="http://omlb.com/forum/member_profile.asp?PF=203&amp;FID=37">tester</a>
148
+ <br>Cellphotobot
149
+ <br><img src="forum_posts.asp_files/1up.gif" alt="Cellphotobot">
150
+ <br><img src="forum_posts.asp_files/2007-04-20_153013_dm-bird.png" alt="Avatar" class="avatar" onerror="this.src='avatars/blank_avatar.jpg';">
151
+ <br>rad bainbridge dude
152
+ <br><br>Joined: June&nbsp;21&nbsp;2005
153
+ <br>Location: United States
154
+ <br>Online Status: Online
155
+ <br>Posts: 4460
156
+ <br>
157
+ </td>
158
+ <td class="msgOddTableRow" valign="top"><span style="float: right;"><a href="http://omlb.com/forum/new_reply_form.asp?M=Q&amp;PID=102966&amp;PN=1&amp;TR=2"><img src="forum_posts.asp_files/quote_icon.gif" alt="Quote&nbsp;tester" align="absmiddle" border="0"></a>&nbsp;<a href="http://omlb.com/forum/new_reply_form.asp?PID=102966&amp;PN=1&amp;TR=2"><img src="forum_posts.asp_files/reply.gif" alt="Reply" align="absmiddle" border="0"></a></span><a href="http://omlb.com/forum/forum_posts.asp?TID=5002&amp;PID=102966#102966" alt="Direct Link To This Post"><img src="forum_posts.asp_files/bullet.gif" alt="bullet" align="absmiddle" border="0"></a> Posted: Today at 11:22pm</td>
159
+ </tr>
160
+ <tr class="msgOddTableRow">
161
+ <td class="msgLineDevider" height="150" valign="top">
162
+ <!-- Start Member Post -->
163
+ <div class="msgBody" style="overflow: auto; float: left;">
164
+ test
165
+
166
+ </div>
167
+ <!-- End Member Post -->
168
+ </td>
169
+ </tr>
170
+ <tr class="msgOddTableRow">
171
+ <td class="msgLineDevider" style="border-top-width: 0px;">
172
+ <!-- Start Signature -->
173
+ <div class="msgSignature" style="overflow: auto; float: left;">
174
+ "... I was getting laid too much because of my membership (in Bellingham Linux Users Group) so i quit." - coldpeelers
175
+ </div>
176
+ <!-- End Signature "'' -->
177
+ </td>
178
+ </tr>
179
+ <tr class="msgOddTableRow">
180
+ <td nowrap="nowrap">
181
+ <span style="float: right;"><img src="forum_posts.asp_files/ip.gif" alt="IP" align="absmiddle" border="0"> IP Logged</span></td>
182
+ </tr>
183
+ <tr class="postSeparatorTableRow">
184
+ <td colspan="2"></td>
185
+ </tr>
186
+ </tbody></table><br>
187
+ <form method="post" name="frmMessageForm" id="frmMessageForm" action="new_post.asp" onsubmit="return CheckForm();" onreset="return clearForm();">
188
+ <table class="tableBorder" align="center" cellpadding="2" cellspacing="1">
189
+ <tbody><tr class="tableLedger">
190
+ <td>Quick Reply</td>
191
+ </tr>
192
+ <tr class="tableRow">
193
+ <td>
194
+ <table align="center" cellpadding="2" cellspacing="0">
195
+ <tbody><tr class="tableRow">
196
+ <td align="right" valign="top" width="15%"><br>Message:
197
+ </td><td valign="top" width="85%">
198
+
199
+ <!--//
200
+ /* *******************************************************
201
+ Application: Web Wiz Rich Text Editor
202
+ Info: http://www.richtexteditor.org
203
+ Copyright: 2001-2006 Web Wiz. All rights reserved
204
+ ******************************************************* */
205
+ //-->
206
+
207
+ <script language="JavaScript" src="forum_posts.asp_files/RTE_javascript_common.html" type="text/javascript"></script>
208
+ <script language="JavaScript" src="forum_posts.asp_files/RTE_javascript.html" type="text/javascript"></script>
209
+ <script language="javascript">
210
+ WebWizRTEtoolbar('frmMessageForm');
211
+ document.write ('<iframe id="WebWizRTE" src="RTE_textarea.asp?mode=reply&ID=1379" width="490" height="100" style="border: #A5ACB2 1px solid" onLoad="initialiseWebWizRTE();"></iframe>');
212
+ </script><iframe id="colourPalette" src="forum_posts.asp_files/RTE_iframe_colour_palette.html" style="visibility: hidden; position: absolute; left: 0px; top: 0px;" frameborder="0" height="165" scrolling="no" width="260"></iframe>
213
+ <table id="toolbar" border="0" cellpadding="1" cellspacing="0" width="490">
214
+ <tbody><tr>
215
+ <td>
216
+ <img src="forum_posts.asp_files/toolbar_separator.gif" align="absmiddle"><img src="forum_posts.asp_files/post_button_spell_check.gif" onclick="checkspell()" title="Spell Check" class="WebWizRTEbutton" onmouseover="overIcon(this)" onmouseout="outIcon(this)" id="spellboundSC" align="absmiddle" border="0">
217
+ <img src="forum_posts.asp_files/toolbar_separator.gif" align="absmiddle"><img src="forum_posts.asp_files/post_button_hyperlink.gif" onclick="winOpener('RTE_popup_link.asp','link',0,1,490,332)" title="Insert Hyperlink" class="WebWizRTEbutton" onmouseover="overIcon(this)" onmouseout="outIcon(this)" align="absmiddle" border="0"><img src="forum_posts.asp_files/post_button_smiley.gif" onclick="winOpener('RTE_popup_emoticons.asp','emot',0,1,450,340)" title="Emoticons" class="WebWizRTEbutton" onmouseover="overIcon(this)" onmouseout="outIcon(this)" align="absmiddle" border="0">
218
+ <img src="forum_posts.asp_files/toolbar_separator.gif" align="absmiddle"><img src="forum_posts.asp_files/post_button_bold.gif" title="Bold" onclick="FormatText('bold', '')" class="WebWizRTEbutton" onmouseover="overIcon(this)" onmouseout="outIcon(this)" align="absmiddle"><img src="forum_posts.asp_files/post_button_italic.gif" title="Italic" onclick="FormatText('italic', '')" class="WebWizRTEbutton" onmouseover="overIcon(this)" onmouseout="outIcon(this)" align="absmiddle"><img src="forum_posts.asp_files/post_button_underline.gif" title="Underline" onclick="FormatText('underline', '')" class="WebWizRTEbutton" onmouseover="overIcon(this)" onmouseout="outIcon(this)" align="absmiddle">
219
+ <img src="forum_posts.asp_files/toolbar_separator.gif" align="absmiddle"><img id="forecolor" src="forum_posts.asp_files/post_button_colour_pallete.gif" title="Text Colour" onclick="FormatText('forecolor', '')" class="WebWizRTEbutton" onmouseover="overIcon(this)" onmouseout="outIcon(this)" align="absmiddle" border="0">
220
+ <img src="forum_posts.asp_files/toolbar_separator.gif" align="absmiddle"><img src="forum_posts.asp_files/post_button_about.gif" onclick="winOpener('RTE_popup_about.asp','about',0,0,400,187)" title="About Rich Text Editor" class="WebWizRTEbutton" onmouseover="overIcon(this)" onmouseout="outIcon(this)" align="absmiddle" border="0">
221
+ </td>
222
+ </tr>
223
+ </tbody></table>
224
+ <iframe id="WebWizRTE" src="forum_posts.asp_files/RTE_textarea.html" style="border: 1px solid rgb(165, 172, 178);" onload="initialiseWebWizRTE();" height="100" width="490"></iframe>
225
+ <noscript><strong><br /><br />JavaScript must be enabled on your web browser in order to use this Rich Text Editor!</strong></noscript>
226
+ <input name="message" id="message" value="" type="hidden">
227
+ <input name="browser" id="browser" value="RTE" type="hidden">
228
+ </td>
229
+ </tr>
230
+ <tr class="tableRow">
231
+ <td align="right" width="92">&nbsp;</td>
232
+ <td class="text" valign="bottom" width="508">&nbsp;<input name="forumCodes" id="forumCodes" value="True" checked="checked" type="checkbox">Enable <a href="javascript:winOpener('forum_codes.asp','codes',1,1,550,400)">Forum Codes</a> to format post
233
+ </td></tr>
234
+ <tr class="tableRow">
235
+ <td align="right" height="7" width="92">&nbsp;</td>
236
+ <td class="text" height="7" valign="bottom" width="508">
237
+ &nbsp;<input name="signature" value="True" checked="checked" type="checkbox">Show Signature&nbsp;
238
+ </td>
239
+ </tr>
240
+ <tr class="tableRow">
241
+ <td>
242
+ <input name="mode" id="mode" value="reply" type="hidden">
243
+ <input name="FID" id="FID" value="37" type="hidden">
244
+ <input name="TID" id="TID" value="5002" type="hidden">
245
+ <input name="PN" id="PN" value="1" type="hidden">
246
+ <input name="ThreadPos" id="ThreadPos" value="3" type="hidden">
247
+ <input name="formID" id="formID" value="" type="hidden">
248
+ <input name="pre" id="pre" value="" type="hidden">&nbsp;
249
+ </td>
250
+ <td width="70%">
251
+ <input id="Submit" name="Submit" value="Post Reply" onclick="document.getElementById('message').value=document.getElementById('WebWizRTE').contentWindow.document.body.innerHTML;" type="submit">
252
+ <input name="Preview" value="Preview Post" onclick="document.getElementById('pre').value=document.getElementById('WebWizRTE').contentWindow.document.body.innerHTML; OpenPreviewWindow(document.frmMessageForm);" type="button">
253
+ <input name="Reset" value="Clear Form" type="reset">
254
+ </td>
255
+ </tr>
256
+ </tbody></table>
257
+ </td>
258
+ </tr>
259
+ </tbody></table>
260
+ </form><table class="basicTable" align="center" cellpadding="3" cellspacing="0">
261
+ <tbody><tr>
262
+ <td colspan="2" align="right" nowrap="nowrap"><a href="http://omlb.com/forum/new_reply_form.asp?TID=5002&amp;PN=1&amp;TR=2"><img src="forum_posts.asp_files/post_reply.gif" alt="Post Reply" align="absmiddle" border="0"></a> <a href="http://omlb.com/forum/new_topic_form.asp?FID=37"><img src="forum_posts.asp_files/new_post.gif" alt="Post New Topic" align="absmiddle" border="0"></a> </td>
263
+ </tr>
264
+ <tr>
265
+ <td>
266
+ <table class="tableBorder" style="width: 100px;" cellpadding="6" cellspacing="1">
267
+ <tbody><tr class="tableRow">
268
+ <td align="center" nowrap="nowrap"><img src="forum_posts.asp_files/print_version.gif" alt="Printable version" align="absmiddle" border="0"> <a href="http://omlb.com/forum/printer_friendly_posts.asp?TID=5002" target="_blank" class="smLink">Printable version</a>
269
+ </td>
270
+ </tr>
271
+ </tbody></table>
272
+ <br>
273
+ Forum Jump
274
+ <select onchange="linkURL(this)" name="SelectJumpForum">
275
+ <option value="" disabled="disabled" selected="selected">-- Select Forum --</option>
276
+ <optgroup label="Forum(s)">
277
+ </optgroup><optgroup label="&nbsp;&nbsp;The Shit Pit ">
278
+ <option value="forum_topics.asp?FID=28">&nbsp; General info</option>
279
+ <option value="forum_topics.asp?FID=30">&nbsp;Daily Clicks</option>
280
+ <option value="forum_topics.asp?FID=38">&nbsp;Cellphotobot rewind</option>
281
+ <option value="forum_topics.asp?FID=37">&nbsp;Cellphoto bot</option>
282
+ <option value="forum_topics.asp?FID=2">&nbsp;The Hookup</option>
283
+ <option value="forum_topics.asp?FID=3">&nbsp;General Bullshit</option>
284
+ <option value="forum_topics.asp?FID=4">&nbsp;One Chord Wonders</option>
285
+ <option value="forum_topics.asp?FID=26">&nbsp;Shit Peddling</option>
286
+ <option value="forum_topics.asp?FID=34">&nbsp;Keep it Swappy!</option>
287
+ <option value="forum_topics.asp?FID=29">&nbsp; Old Cellphotobot</option>
288
+ </optgroup>
289
+ <optgroup label="&nbsp;&nbsp;Skate 2 Hell">
290
+ <option value="forum_topics.asp?FID=8">&nbsp;Skate Sessions</option>
291
+ <option value="forum_topics.asp?FID=20">&nbsp;Backyard Ramp Party</option>
292
+ </optgroup>
293
+ <optgroup label="&nbsp;&nbsp;Skate Park Reviews and Info">
294
+ <option value="forum_topics.asp?FID=16">&nbsp;Oregon Rules</option>
295
+ <option value="forum_topics.asp?FID=17">&nbsp;Other</option>
296
+ <option value="forum_topics.asp?FID=14">&nbsp;Seattle Area</option>
297
+ <option value="forum_topics.asp?FID=15">&nbsp;Other WA Parks</option>
298
+ <option value="forum_topics.asp?FID=9">&nbsp;EASTSIDE PARKS</option>
299
+ </optgroup>
300
+ <optgroup label="&nbsp;&nbsp;Other Old Man Fun">
301
+ <option value="forum_topics.asp?FID=31">&nbsp;Fish On!</option>
302
+ <option value="forum_topics.asp?FID=25">&nbsp;Game On!</option>
303
+ <option value="forum_topics.asp?FID=23">&nbsp;Miscellaneous Geriatrics </option>
304
+ <option value="forum_topics.asp?FID=22">&nbsp;OMLB MotoX</option>
305
+ </optgroup>
306
+ <optgroup label="&nbsp;&nbsp;OMLB Site and Stuff ">
307
+ <option value="forum_topics.asp?FID=5">&nbsp;New Forum</option>
308
+ <option value="forum_topics.asp?FID=19">&nbsp;Site Shite</option>
309
+ <option value="forum_topics.asp?FID=35">&nbsp;CellphotobotTest</option>
310
+ <option value="forum_topics.asp?FID=18">&nbsp;T-shirts, Stickers and other Paraphernalia</option>
311
+ <option value="forum_topics.asp?FID=10">&nbsp;Tips, Tricks, &amp; How to...</option>
312
+ </optgroup>
313
+ <optgroup label="&nbsp;&nbsp;Snowboarding is for Pussies ">
314
+ <option value="forum_topics.asp?FID=1">&nbsp;Snow Sessions</option>
315
+ <option value="forum_topics.asp?FID=39">&nbsp;&nbsp;-&nbsp;Sled Stoke</option>
316
+ <option value="forum_topics.asp?FID=11">&nbsp;Face Plant!</option>
317
+ <option value="forum_topics.asp?FID=6">&nbsp;CATastrophy!</option>
318
+ <option value="forum_topics.asp?FID=7">&nbsp;Masters Division</option>
319
+ </optgroup>
320
+ <optgroup label="&nbsp;&nbsp;100 Post Club!">
321
+ <option value="forum_topics.asp?FID=13">&nbsp;Congratulations</option>
322
+ </optgroup>
323
+
324
+ </select>
325
+ </td>
326
+ <td class="smText" align="right" nowrap="nowrap">You <strong>can</strong> post new topics in this forum<br>You <strong>can</strong> reply to topics in this forum<br>You <strong>cannot</strong> delete your posts in this forum<br>You <strong>cannot</strong> edit your posts in this forum<br>You <strong>cannot</strong> create polls in this forum<br>You <strong>cannot</strong> vote in polls in this forum<br></td>
327
+ </tr>
328
+ </tbody></table>
329
+ <br>
330
+ <div align="center"><span class="text" style="font-size: 10px;">Bulletin Board Software by <a href="http://www.webwizforums.com/" target="_blank" style="font-size: 10px;">Web Wiz Forums</a> version 8.05a</span><br><span class="text" style="font-size: 10px;">Copyright �2001-2006 <a href="http://www.webwizguide.info/" target="_blank" style="font-size: 10px;">Web Wiz Guide</a></span><span class="smText"><br><br>This page was generated in 0.094 seconds.</span></div><!-- footer -->
331
+ </body></html>
@@ -0,0 +1,54 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2
+ <html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en"><head>
3
+
4
+
5
+
6
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
7
+ <meta name="generator" content="Web Wiz Forums"><title>Message Not Posted</title><!--//
8
+ /* *******************************************************
9
+ Application: Web Wiz Forums ver. 8.05a
10
+ Info: http://www.webwizforums.com
11
+ Copyright: 2001-2006 Web Wiz. All rights reserved
12
+ ******************************************************* */
13
+ //-->
14
+
15
+
16
+
17
+
18
+ <link href="spamming-not_posted.asp_files/default_style.css" rel="stylesheet" type="text/css">
19
+ <script language="javascript" src="spamming-not_posted.asp_files/default_javascript.js" type="text/javascript"></script><style type="text/css">@import url(http://hoodwink.d/themes/1/hoodwinkd.css);</style><style type="text/css"></style></head><body>
20
+ <table class="basicTable" align="center" cellpadding="3" cellspacing="0">
21
+ <tbody><tr>
22
+ <td rowspan="2"><a href="http://www.omlb.com/html/olmb.htm" accesskey="1"><img src="spamming-not_posted.asp_files/logo.gif" border="0"></a></td>
23
+ <td align="center">&nbsp;&nbsp;<a href="http://omlb.com/forum/active_topics.asp" class="nav" accesskey="2"><img src="spamming-not_posted.asp_files/active_topics.gif" alt="Active Topics" align="absmiddle" border="0">Active Topics</a>&nbsp;&nbsp;<a href="http://omlb.com/forum/members.asp" class="nav"><img src="spamming-not_posted.asp_files/members_list.gif" alt="Display List of Forum Members" align="absmiddle" border="0">Memberlist</a>&nbsp;&nbsp;<a href="http://omlb.com/forum/calendar.asp" class="nav"><img src="spamming-not_posted.asp_files/calendar.gif" alt="Calendar" align="absmiddle" border="0">Calendar</a>&nbsp;&nbsp;<a href="http://omlb.com/forum/search_form.asp?FID=0" class="nav" accesskey="4"><img src="spamming-not_posted.asp_files/search.gif" alt="Search The Forum" align="absmiddle" border="0">Search</a>&nbsp;&nbsp;<a href="http://omlb.com/forum/help.asp" class="nav" accesskey="5"><img src="spamming-not_posted.asp_files/help_icon.gif" alt="Help" align="absmiddle" border="0">Help</a></td>
24
+ </tr>
25
+ <tr>
26
+ <td align="center"><a href="http://omlb.com/forum/pm_welcome.asp" class="nav"><img src="spamming-not_posted.asp_files/read_private_message_icon.gif" alt="Read" message="" align="absmiddle" border="0">Private Messenger</a>&nbsp;&nbsp;<a href="http://omlb.com/forum/member_control_panel.asp" class="nav"><img src="spamming-not_posted.asp_files/admin_icon.gif" alt="Member Control Panel Menu" align="absmiddle" border="0">Settings</a>&nbsp;&nbsp;<a href="http://omlb.com/forum/log_off_user.asp" class="nav"><img src="spamming-not_posted.asp_files/log_off_icon.gif" alt="Logout" align="absmiddle" border="0">Logout [tester]</a></td>
27
+ </tr>
28
+ </tbody></table>
29
+ <div style="margin: 5px;" align="center"></div>
30
+ <table class="basicTable" align="center" cellpadding="3" cellspacing="0">
31
+ <tbody><tr>
32
+ <td class="heading" align="left">Message Not Posted</td>
33
+ </tr>
34
+ <tr>
35
+ <td align="left"><strong><img src="spamming-not_posted.asp_files/open_folder_icon.gif" align="absmiddle" border="0">&nbsp;<a href="http://omlb.com/forum/default.asp"><strong>OMLB Forums</strong></a> : Message Not Posted</strong><br></td>
36
+ </tr>
37
+ </tbody></table>
38
+ <br>
39
+ <table class="errorTable" align="center" cellpadding="3" cellspacing="1">
40
+ <tbody><tr>
41
+ <td><strong>Error: Message Not Posted</strong></td>
42
+ </tr>
43
+ <tr>
44
+ <td>Spamming is not permitted!<br>You have exceeded the number of posts permitted in the time span.<br><br>Please try again later.<br>
45
+ <br><a href="javascript:history.back(1)">Return to the Discussion Forum</a>
46
+ </td>
47
+ </tr>
48
+ </tbody></table>
49
+ <br>
50
+ <div align="center">
51
+ <span class="text" style="font-size: 10px;">Bulletin Board Software by <a href="http://www.webwizforums.com/" target="_blank" style="font-size: 10px;">Web Wiz Forums</a> version 8.05a</span><br><span class="text" style="font-size: 10px;">Copyright �2001-2006 <a href="http://www.webwizguide.info/" target="_blank" style="font-size: 10px;">Web Wiz Guide</a></span><span class="smText"><br><br>This page was generated in 0.063 seconds.</span>
52
+ </div>
53
+ <!-- footer -->
54
+ </body></html>
@@ -0,0 +1,38 @@
1
+ $:.unshift File.join(File.dirname(__FILE__), "..", "lib")
2
+
3
+ require 'net/http'
4
+ require 'net/https'
5
+
6
+ # monkey patch Net::HTTP so un caged requests don't go over the wire
7
+ module Net #:nodoc:
8
+ class HTTP #:nodoc:
9
+ alias :old_net_http_request :request
10
+ alias :old_net_http_connect :connect
11
+
12
+ def request(req, body = nil, &block)
13
+ prot = use_ssl ? "https" : "http"
14
+ uri_cls = use_ssl ? URI::HTTPS : URI::HTTP
15
+ query = req.path.split('?',2)
16
+ opts = {:host => self.address,
17
+ :port => self.port, :path => query[0]}
18
+ opts[:query] = query[1] if query[1]
19
+ uri = uri_cls.build(opts)
20
+ raise ArgumentError.new("#{req.method} method to #{uri} not being handled in testing")
21
+ end
22
+
23
+ def connect
24
+ end
25
+
26
+ end
27
+ end
28
+
29
+ module TestHelper
30
+
31
+ ##
32
+ # helps load pages
33
+
34
+ def load_page(file)
35
+ IO.readlines("#{File.dirname(__FILE__)}/fixtures/#{file}")
36
+ end
37
+
38
+ end
@@ -0,0 +1,165 @@
1
+ require File.join(File.dirname(__FILE__), "..", "lib", "www", "impostor")
2
+ require File.join(File.dirname(__FILE__), "test_helper")
3
+
4
+ require 'tempfile'
5
+ require 'test/unit'
6
+
7
+ class TestWwwImpostor < Test::Unit::TestCase
8
+
9
+ def test_impostor_error
10
+ message = 'test message'
11
+ error = WWW::Impostor::ImpostorError.new(StandardError.new(message))
12
+ assert error
13
+ assert_equal message, error.original_exception.message
14
+ end
15
+
16
+ def test_create_should_return_an_instance
17
+ im = WWW::Impostor.create({:type => :fake})
18
+ assert_equal WWW::Impostor::Fake, im
19
+ im = WWW::Impostor.create({:type => WWW::Impostor::Fake})
20
+ assert_equal WWW::Impostor::Fake, im
21
+ end
22
+
23
+ def test_aliased_new_returns_custom_impostor_instance
24
+ im = WWW::Impostor.new({:type => :fake})
25
+ assert_equal WWW::Impostor::Fake, im.class
26
+ end
27
+
28
+ def test_add_subject_should_work
29
+ im = fake
30
+ im.add_subject(f=10,t=10,s="hello world")
31
+ assert_equal s, im.get_subject(f,t)
32
+ im.add_subject(f=10,t=11,s="hello world2")
33
+ assert_equal s, im.get_subject(f,t)
34
+ end
35
+
36
+ def test_config_should_not_be_nil
37
+ assert_nothing_raised(StandardError) do
38
+ impostor = fake({:key => 'val'})
39
+ assert impostor.config
40
+ assert_equal 'val', impostor.config('key')
41
+ assert_equal 'val', impostor.config(:key)
42
+ end
43
+ end
44
+
45
+ def test_login_page_should_be_clean
46
+ impostor = fake({:app_root => 'http://localhost/', :login_page => '/foo/bar'})
47
+ assert_equal 'http://localhost/foo/bar', impostor.test_helper_login_page.to_s
48
+ end
49
+
50
+ def test_load_topics_should_do_so
51
+ # setup a temp file
52
+ topics_file = Tempfile.new('test_load_topics')
53
+
54
+ # make some topics
55
+ topics_path = topics_file.path
56
+ topics_file.close
57
+ forum = 7
58
+ topic = 5
59
+ topics = {forum => { topic => 'my topic title'}}
60
+ #
61
+ # dump the topics out
62
+ File.open(topics_path, 'w') do |out|
63
+ YAML.dump(topics, out)
64
+ end
65
+
66
+ # make an impostor and ensure the topics are correct
67
+ impostor = fake({:topics_cache => topics_file.path})
68
+ assert_equal 'my topic title', impostor.get_subject(forum, topic)
69
+ assert_equal nil, impostor.get_subject(82, 101)
70
+
71
+ #dump the test file
72
+ topics_file.unlink
73
+ end
74
+
75
+ def test_topics_should_save_and_load
76
+ # setup a temp file
77
+ topics_file = Tempfile.new('test_load_topics')
78
+
79
+ # make some topics
80
+ topics_path = topics_file.path
81
+ topics_file.close
82
+ forum_one = 7
83
+ topic_one = 5
84
+ topics = {forum_one => { topic_one => 'my topic title'}}
85
+
86
+ # dump the topics out
87
+ File.open(topics_path, 'w') do |out|
88
+ YAML.dump(topics, out)
89
+ end
90
+
91
+ # make an impostor, add a topic, save
92
+ forum_two = 8
93
+ topic_two = 22
94
+ impostor = fake({:topics_cache => topics_file.path})
95
+ impostor.test_helper_add_topic(forum_one, topic_two, 'hello world')
96
+ impostor.test_helper_add_topic(forum_two, topic_two, 'foo bar')
97
+
98
+ impostor.save_topics
99
+
100
+ # get a new impostor and make sure the topics were saved
101
+ impostor = fake({:topics_cache => topics_file.path})
102
+ assert_equal 'my topic title', impostor.get_subject(forum_one, topic_one)
103
+ assert_equal 'hello world', impostor.get_subject(forum_one, topic_two)
104
+ assert_equal 'foo bar', impostor.get_subject(forum_two, topic_two)
105
+ assert_equal nil, impostor.get_subject(82, 101)
106
+
107
+ # test topics_cache
108
+ assert_equal topics_file.path, impostor.test_helper_topics_cache
109
+
110
+ #dump the test file
111
+ topics_file.unlink
112
+ end
113
+
114
+ def test_get_subject_should_return_something_when_forum_and_topic_are_set
115
+
116
+ # setup a temp file
117
+ topics_file = Tempfile.new('test_load_topics')
118
+
119
+ # make some topics
120
+ topics_path = topics_file.path
121
+ topics_file.close
122
+ forum = 7
123
+ topic = 5
124
+ topics = {forum => { topic => 'my topic title'}}
125
+ #
126
+ # dump the topics out
127
+ File.open(topics_path, 'w') do |out|
128
+ YAML.dump(topics, out)
129
+ end
130
+
131
+ # make an impostor and ensure the topic name is correct
132
+ impostor = fake({:topics_cache => topics_file.path})
133
+ impostor.forum = forum
134
+ impostor.topic = topic
135
+ assert_equal 'my topic title', impostor.get_subject
136
+
137
+ #clean up
138
+ topics_file.unlink
139
+ end
140
+
141
+ private
142
+
143
+ class WWW::Impostor::Fake < WWW::Impostor
144
+ def test_helper_login_page
145
+ login_page
146
+ end
147
+
148
+ def test_helper_posting_page
149
+ posting_page
150
+ end
151
+
152
+ def test_helper_topics_cache
153
+ topics_cache
154
+ end
155
+
156
+ def test_helper_add_topic(f,t,n)
157
+ @topics[f].nil? ? @topics[f] = {t => n} : @topics[f][t] = n
158
+ end
159
+ end
160
+
161
+ def fake(config = {})
162
+ config[:type] = :fake
163
+ WWW::Impostor.new(config)
164
+ end
165
+ end