ianwhite / response_for

response for lets you decorate your actions respond_to blocks

response_for / SPECDOC
100644 150 lines (114 sloc) 6.399 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
 
DefaultRailsBehaviourSpec::TheController GET :two_respond_tos
- should recieve first and second in order
 
DefaultRailsBehaviourSpec::TheController GET :two_responses
- should only receive first and NOT second
 
action_responses
- SuperController.action_responses should not == SubController.action_responses
- SuperController should have one action_response for 'a_response'
- SubController should have two action_responses for 'a_response', and one each for 'an_action', and 'performing_action'
 
InheritedControllerSpec::SuperController GET :an_action
- should execute action
- should render :an_action
 
InheritedControllerSpec::SuperController GET :a_response
- should execute inside the super response block
- should NOT execute inside the sub response block
 
InheritedControllerSpec::SuperController GET :performing_action
- should redirect
 
InheritedControllerSpec::SubController GET :an_action (decorated with redirecting response_for)
- should execute action
- should redirect
 
InheritedControllerSpec::SubController GET :a_response (decorated with a new response)
- should NOT execute the super response
- should execute the sub response
 
InheritedControllerSpec::SubController GET :performing_action
- should NOT execute the sub response
- should redirect as per the super def
 
NoResponseIfPerformedSpec::TheController when before_filter redirects, GET :an_action
- should redirect to 'http://redirected.from.before_filter'
- should not execute inside response_for
 
NoResponseIfPerformedSpec::TheController when before_filter doesn't redirect, GET :an_action
- should execute inside response for
- should render :an_action
 
Picking template PickTemplateSpec::TemplateOnlyController GET :an_action, HTTP_ACCEPT =
- text/html, should render an_action.html
- application/xml, should IGNORE and render an_action.html
 
Picking template [:atom, :xml, :html, :js] PickTemplateSpec::RespondToTypesController
- GET :an_action, should render an_action.atom
 
Picking template [:atom, :xml, :html, :js] PickTemplateSpec::RespondToTypesController GET :an_action, HTTP_ACCEPT =
- text/html, should render an_action.html
- application/xml, should render an_action.xml
- text/javascript, should render an_action.js
- application/atom+xml, should render an_action.atom
 
Picking template [:atom, :xml, :html, :js] PickTemplateSpec::RespondToTypesController GET :an_action, :format =>
- :html, should render an_action.html
- :js, should render an_action.js
- :xml, should render an_action.xml
- :atom, should render an_action.atom
 
Picking template [:atom, :xml, :html, :js] PickTemplateSpec::RespondToBlockController
- GET :an_action, should render an_action.atom
 
Picking template [:atom, :xml, :html, :js] PickTemplateSpec::RespondToBlockController GET :an_action, HTTP_ACCEPT =
- text/html, should render an_action.html
- application/xml, should render an_action.xml
- text/javascript, should render an_action.js
- application/atom+xml, should render an_action.atom
 
Picking template [:atom, :xml, :html, :js] PickTemplateSpec::RespondToBlockController GET :an_action, :format =>
- :html, should render an_action.html
- :js, should render an_action.js
- :xml, should render an_action.xml
- :atom, should render an_action.atom
 
Picking template [:atom, :xml, :html, :js] PickTemplateSpec::ResponseForTypesController
- GET :an_action, should render an_action.atom
 
Picking template [:atom, :xml, :html, :js] PickTemplateSpec::ResponseForTypesController GET :an_action, HTTP_ACCEPT =
- text/html, should render an_action.html
- application/xml, should render an_action.xml
- text/javascript, should render an_action.js
- application/atom+xml, should render an_action.atom
 
Picking template [:atom, :xml, :html, :js] PickTemplateSpec::ResponseForTypesController GET :an_action, :format =>
- :html, should render an_action.html
- :js, should render an_action.js
- :xml, should render an_action.xml
- :atom, should render an_action.atom
 
Picking template [:atom, :xml, :html, :js] PickTemplateSpec::ResponseForBlockController
- GET :an_action, should render an_action.atom
 
Picking template [:atom, :xml, :html, :js] PickTemplateSpec::ResponseForBlockController GET :an_action, HTTP_ACCEPT =
- text/html, should render an_action.html
- application/xml, should render an_action.xml
- text/javascript, should render an_action.js
- application/atom+xml, should render an_action.atom
 
Picking template [:atom, :xml, :html, :js] PickTemplateSpec::ResponseForBlockController GET :an_action, :format =>
- :html, should render an_action.html
- :js, should render an_action.js
- :xml, should render an_action.xml
- :atom, should render an_action.atom
 
Picking template [:atom, :xml, :html, :js] PickTemplateSpec::ResponseForMixOfBlockAndTypesController
- GET :an_action, should render an_action.atom
 
Picking template [:atom, :xml, :html, :js] PickTemplateSpec::ResponseForMixOfBlockAndTypesController GET :an_action, HTTP_ACCEPT =
- text/html, should render an_action.html
- application/xml, should render an_action.xml
- text/javascript, should render an_action.js
- application/atom+xml, should render an_action.atom
 
Picking template [:atom, :xml, :html, :js] PickTemplateSpec::ResponseForMixOfBlockAndTypesController GET :an_action, :format =>
- :html, should render an_action.html
- :js, should render an_action.js
- :xml, should render an_action.xml
- :atom, should render an_action.atom
 
Picking template [:atom, :xml, :html, :js] PickTemplateSpec::InheritedController
- GET :an_action, should render an_action.atom
 
Picking template [:atom, :xml, :html, :js] PickTemplateSpec::InheritedController GET :an_action, HTTP_ACCEPT =
- text/html, should render an_action.html
- application/xml, should render an_action.xml
- text/javascript, should render an_action.js
- application/atom+xml, should render an_action.atom
 
Picking template [:atom, :xml, :html, :js] PickTemplateSpec::InheritedController GET :an_action, :format =>
- :html, should render an_action.html
- :js, should render an_action.js
- :xml, should render an_action.xml
- :atom, should render an_action.atom
 
RemoveResponseForSpec::TheController
- should have action_responses for :foo and :bar
 
RemoveResponseForSpec::TheController.remove_response_for :bar
- should hanve action_responses for :foo
 
RemoveResponseForSpec::TheController.remove_response_for
- should have empty action_responses
 
Finished in 0.451715 seconds
 
79 examples, 0 failures