public
Description: response for lets you decorate your actions respond_to blocks
Homepage: http://blog.ardes.com/response_for
Clone URL: git://github.com/ianwhite/response_for.git
Click here to lend your support to: response_for and make a donation at www.pledgie.com !
response_for / SPECDOC
100644 51 lines (39 sloc) 1.666 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
 
BackToFooController
- get :foo, :format => 'xml' should not render foo
 
FooBailOutController
- get :foo, :bail_out => true should redirect
 
FooController
- get :foo should render text/html: foo
- get :foo should assign @foo
- get :foo, :format => 'html' should render foo
- get :foo, :format => 'xml' should not render foo
 
FooAController
- get :foo should call a
- get :baz should call bazza (inside the response_for block)
 
FooBController
- get :foo should call b
 
InlineXmlFooController
- get :foo should assign @foo
- get :foo, :format => 'html' should render 'foo'
- get :foo, :format => 'xml' should call xml_call with 'foo
- get :foo, :format => 'xml' should have response.body of 'XML'
 
XmlFooController
- get :foo should render foo
- get :foo should assign @foo
- get :foo, :format => 'html' should render foo
- get :foo, :format => 'xml' should render foo
- get :bar, :format => 'xml' should render bar
 
XmlOnlyFooController
- get :foo should render xml: foo
- get :bar should render xml: bar
- get :foo should assign @foo
- get :foo, :format => 'html' should not render foo
- get :foo, :format => 'xml' should render foo
 
class method #action_responses
- @child.action_responses[:action] should be copy of parent's action response for :action
- @grandchild.action_responses[:action] should be copy of @child.action_responses[:action]
- @child.action_responses[:action] not be same object as parent's action response for :action
- @grandchild.action_responses[:action] not be same object as @child.action_responses[:action]
- adding to @grandchild.action_responses[:action] should not change parents
 
Finished in 0.328216 seconds
 
28 examples, 0 failures