ianwhite / response_for

response for lets you decorate your actions respond_to blocks

This URL has Read+Write access

ianwhite (author)
Fri Oct 10 01:15:45 -0700 2008
commit  0cb80d7a78efab2be80d2f99bfac3699a9c2dcdc
tree    5bcb7c6ae6d03ac0cf9b0055477943a3ecd52a91
parent  3d94fabcf545d0c46710b1c3832be9bd774259b4
response_for / SPECDOC
100644 179 lines (137 sloc) 7.675 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
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
 
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
 
ResponsesModuleSpec::MyController
- should have action_response for :foo
- should have action :foo
- should have method defined by included
 
StackingResponsesSpec::TheController with responses conditionally executed GET :foo (no conditions)
- should execute second, then first, response
- should NOT execute the html response in first
- should NOT execute the html response in second
- should render :action => :foo (the default response)
 
StackingResponsesSpec::TheController with responses conditionally executed GET :foo, :second => true
- should execute second, then first, then html second, response
- should redirect from second response
- should NOT execute first html response
 
StackingResponsesSpec::TheController with responses conditionally executed GET :foo, :first => true
- should execute second, then first, then first html response
- should redirect from first response
- should NOT execute second html response
 
StackingResponsesSpec::TheController with responses conditionally executed GET :foo, :first => true, :second => true (can't execute two html blocks)
- should execute second, then first, then second html response
- should redirect from second response
- should NOT execute first html response
 
Ardes::ResponseFor::VERSION
- STRING should be 0.2.1
 
Finished in 0.851266 seconds
 
96 examples, 0 failures