public
Description: Repository for improving Rails documentation
Homepage: http://www.rubyonrails.org
Clone URL: git://github.com/lifo/doc-rails.git
Search Repo:
Formatting capitalization in test_process.rb file.
metaskills (author)
Wed Apr 23 12:45:28 -0700 2008
commit  4dfb9d83e925ff9812d9c7e52c14fed9baed2b82
tree    435f1b19a0e7b8eddc4d6b5a42dd74f3ee70bd4e
parent  f1b8e8100868a781e73092086d1d86b0c877ba3a
...
155
156
157
158
 
159
160
161
162
163
 
164
165
166
167
168
169
170
171
...
169
170
171
172
 
173
174
175
176
177
 
178
179
180
181
182
 
183
184
185
186
187
 
188
189
190
191
192
193
194
 
195
196
197
198
199
 
200
201
202
...
205
206
207
208
 
209
210
211
212
213
214
215
216
217
218
219
220
...
217
218
219
220
 
221
222
223
224
225
 
226
227
228
229
230
 
231
232
233
234
235
 
236
237
238
239
240
 
241
242
243
244
245
 
246
247
248
249
250
 
251
252
253
254
255
 
256
257
258
259
260
261
262
263
 
264
265
266
...
155
156
157
 
158
159
160
161
162
 
163
164
165
166
167
168
169
170
171
...
169
170
171
 
172
173
174
175
176
 
177
178
179
180
181
 
182
183
184
185
186
 
187
188
189
190
191
192
193
 
194
195
196
197
198
 
199
200
201
202
...
205
206
207
 
208
209
210
211
212
213
214
215
216
217
218
219
220
...
217
218
219
 
220
221
222
223
224
 
225
226
227
228
229
 
230
231
232
233
234
 
235
236
237
238
239
 
240
241
242
243
244
 
245
246
247
248
249
 
250
251
252
253
254
 
255
256
257
258
259
260
 
261
 
262
263
264
265
0
@@ -155,12 +155,12 @@
0
   # A refactoring of TestResponse to allow the same behavior to be applied
0
   # to the "real" CgiResponse class in integration tests.
0
   module TestResponseBehavior #:nodoc:
0
- # the response code of the request
0
+ # The response code of the request
0
     def response_code
0
       headers['Status'][0,3].to_i rescue 0
0
     end
0
     
0
- # returns a String to ensure compatibility with Net::HTTPResponse
0
+ # Returns a String to ensure compatibility with Net::HTTPResponse
0
     def code
0
       headers['Status'].to_s.split(' ')[0]
0
     end
0
0
0
0
0
0
@@ -169,34 +169,34 @@
0
       headers['Status'].to_s.split(' ',2)[1]
0
     end
0
 
0
- # was the response successful?
0
+ # Was the response successful?
0
     def success?
0
       response_code == 200
0
     end
0
 
0
- # was the URL not found?
0
+ # Was the URL not found?
0
     def missing?
0
       response_code == 404
0
     end
0
 
0
- # were we redirected?
0
+ # Were we redirected?
0
     def redirect?
0
       (300..399).include?(response_code)
0
     end
0
 
0
- # was there a server-side error?
0
+ # Was there a server-side error?
0
     def error?
0
       (500..599).include?(response_code)
0
     end
0
 
0
     alias_method :server_error?, :error?
0
 
0
- # returns the redirection location or nil
0
+ # Returns the redirection location or nil
0
     def redirect_url
0
       headers['Location']
0
     end
0
 
0
- # does the redirect location match this regexp pattern?
0
+ # Does the redirect location match this regexp pattern?
0
     def redirect_url_match?( pattern )
0
       return false if redirect_url.nil?
0
       p = Regexp.new(pattern) if pattern.class == String
0
@@ -205,7 +205,7 @@
0
       p.match(redirect_url) != nil
0
     end
0
 
0
- # returns the template path of the file which was used to
0
+ # Returns the template path of the file which was used to
0
     # render this response (or nil)
0
     def rendered_file(with_controller=false)
0
       unless template.first_render.nil?
0
0
0
0
0
0
0
0
0
0
@@ -217,50 +217,49 @@
0
       end
0
     end
0
 
0
- # was this template rendered by a file?
0
+ # Was this template rendered by a file?
0
     def rendered_with_file?
0
       !rendered_file.nil?
0
     end
0
 
0
- # a shortcut to the flash (or an empty hash if no flash.. hey! that rhymes!)
0
+ # A shortcut to the flash. Returns an empyt hash if no session flash exists.
0
     def flash
0
       session['flash'] || {}
0
     end
0
 
0
- # do we have a flash?
0
+ # Do we have a flash?
0
     def has_flash?
0
       !session['flash'].empty?
0
     end
0
 
0
- # do we have a flash that has contents?
0
+ # Do we have a flash that has contents?
0
     def has_flash_with_contents?
0
       !flash.empty?
0
     end
0
 
0
- # does the specified flash object exist?
0
+ # Does the specified flash object exist?
0
     def has_flash_object?(name=nil)
0
       !flash[name].nil?
0
     end
0
 
0
- # does the specified object exist in the session?
0
+ # Does the specified object exist in the session?
0
     def has_session_object?(name=nil)
0
       !session[name].nil?
0
     end
0
 
0
- # a shortcut to the template.assigns
0
+ # A shortcut to the template.assigns
0
     def template_objects
0
       template.assigns || {}
0
     end
0
 
0
- # does the specified template object exist?
0
+ # Does the specified template object exist?
0
     def has_template_object?(name=nil)
0
       !template_objects[name].nil?
0
     end
0
 
0
     # Returns the response cookies, converted to a Hash of (name => CGI::Cookie) pairs
0
- # Example:
0
     #
0
- # assert_equal ['AuthorOfNewPage'], r.cookies['author'].value
0
+ # assert_equal ['AuthorOfNewPage'], r.cookies['author'].value
0
     def cookies
0
       headers['cookie'].inject({}) { |hash, cookie| hash[cookie.name] = cookie; hash }
0
     end

Comments

    No one has commented yet.