public
Description: The ultra-lightweight ultra-flexible blogging engine with a fetish for birds and misspellings.
Homepage: http://chyrp.net/
Clone URL: git://github.com/vito/chyrp.git
Click here to lend your support to: chyrp and make a donation at www.pledgie.com !
* Fixed creating posts ignoring various externalities because I added pleasant 
default values to its parameters.
* Fixed the tester's "view page" and "view post" tests.
vito (author)
Sat Nov 01 07:43:34 -0700 2008
commit  28b3e8935d2197ed887168cf952c9716db2227c5
tree    f8a3e4967b064fa7ea41d339c2c490c57c5c2cf7
parent  3544192d8a4eac018f312cb9eb6f6d4c7076754f
...
150
151
152
 
 
153
154
155
...
175
176
177
178
179
180
181
 
 
 
 
182
183
184
...
150
151
152
153
154
155
156
157
...
177
178
179
 
 
 
 
180
181
182
183
184
185
186
0
@@ -150,6 +150,8 @@
0
          *
0
          * Calls the @add_post@ trigger with the inserted post and extra options.
0
          *
0
+         * Note: The default parameter values are empty here so that the fallbacks work properly.
0
+         *
0
          * Parameters:
0
          *     $values - The data to insert.
0
          *     $clean - The sanitized URL (or empty to default to "(feather).(new post's id)").
0
@@ -175,10 +177,10 @@
0
                             $url        = "",
0
                             $feather    = null,
0
                             $user       = null,
0
-                            $pinned     = false,
0
-                            $status     = "public",
0
-                            $created_at = null,
0
-                            $updated_at = "0000-00-00 00:00:00",
0
+                            $pinned     = null,
0
+                            $status     = "",
0
+                            $created_at = "",
0
+                            $updated_at = "",
0
                             $trackbacks = "",
0
                             $pingbacks  = true,
0
                             $options    = array()) {
...
15
16
17
 
 
18
19
20
...
78
79
80
81
 
82
83
 
84
85
86
...
100
101
102
103
 
104
105
106
...
15
16
17
18
19
20
21
22
...
80
81
82
 
83
84
 
85
86
87
88
...
102
103
104
 
105
106
107
108
0
@@ -15,6 +15,8 @@ SERVER = Net::HTTP.new "localhost"
0
 
0
 CHYRP = "/chyrp"
0
 
0
+URL = "http://localhost/chyrp"
0
+
0
 HEADERS = {
0
   "Cookie" => "ChyrpSession=e5f9cd17ab00580649ce618791b5675a", # NOTE: This has to be changed to keep in sync with your browser.
0
   "User-Agent" => "tester.rb"
0
@@ -78,9 +80,9 @@ class Chyrp < Test::Unit::TestCase
0
   def test_view_post
0
     resp, page = test_index
0
     page = Hpricot(page)
0
-    return unless page =~ /class="post /
0
+    return unless page.to_s =~ /class="post /
0
 
0
-    post_url = (page/".post:first/h2/a").attr("href")
0
+    post_url = (page/".post:first/h2/a").attr("href").sub(URL, "")
0
 
0
     get post_url
0
   end
0
@@ -100,7 +102,7 @@ class Chyrp < Test::Unit::TestCase
0
     first_page = (page/"#sidebar/ul:nth(0)/li:nth(0)/a")
0
     return unless first_page
0
 
0
-    page_url = first_page.attr("href")
0
+    page_url = first_page.attr("href").sub(URL, "")
0
 
0
     get page_url
0
   end

Comments