Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 32 lines (22 sloc) 0.725 kb
d1fadd9 Eloy Durán Initial import
alloy authored
1 == RequestStubber
2
3 Allows you to stub a request by either delaying the request time,
4 returning a specific response code, or a combination of both.
5
6 Note that the RequestStubber module is only mixed-in in development mode.
7
8 === Example
9
10 Delays the process time of the request, by n seconds.
11
12 class UsersController
13 def index
14 # ...
15 end
16
17 # Any request send to :index will be delayed 2 seconds.
18 delay :index, 2
19 end
20
21 Returns the specified response code.
22
23 class UsersController
24 def index
25 # ...
26 end
27
28 # Any request send to :index will return a 404 response code.
29 respond :index, 404
30 end
31
32 Copyright (c) 2008 Fingertips, Eloy Duran <e.duran@fngtps.com>, released under the MIT license
Something went wrong with that request. Please try again.