public
Rubygem
Description: Makes tests easy on the fingers and the eyes
Homepage: http://www.thoughtbot.com/projects/shoulda
Clone URL: git://github.com/thoughtbot/shoulda.git
Added :all as valid option for formats and actions

git-svn-id: https://svn.thoughtbot.com/plugins/shoulda/trunk@167 
7bbfaf0e-4d1d-0410-9690-a8bb5f8ef2aa
tsaleh (author)
Sun Aug 12 08:12:50 -0700 2007
commit  d9d555d61e5c7f3a3003758df64cc644589c9bae
tree    13038ec5f532f98cfac44db39e34bd33ab7c639c
parent  071fac8287fc238e7042d43ecc26e2e90cdbb6a5
...
136
137
138
 
139
140
141
...
179
180
181
 
182
183
184
185
186
187
188
 
 
189
190
191
...
214
215
216
 
 
 
 
217
218
219
...
136
137
138
139
140
141
142
...
180
181
182
183
184
185
186
187
188
189
 
190
191
192
193
194
...
217
218
219
220
221
222
223
224
225
226
0
@@ -136,6 +136,7 @@ module ThoughtBot # :nodoc:
0
 
0
             # Actions that should be denied (only used by resource.denied). <i>Note that these actions will
0
             # only be tested if they are also listed in +resource.actions+</i>
0
+ # The special value of :all will deny all of the REST actions.
0
             attr_accessor :actions
0
           end
0
 
0
@@ -179,13 +180,15 @@ module ThoughtBot # :nodoc:
0
           
0
           # Actions that should be tested. Must be a subset of VALID_ACTIONS (default).
0
           # Tests for each actionw will only be generated if the action is listed here.
0
+ # The special value of :all will test all of the REST actions.
0
           #
0
           # Example (for a read-only controller):
0
           # resource.actions = [:show, :index]
0
           attr_accessor :actions
0
 
0
           # Formats that should be tested. Must be a subset of VALID_FORMATS (default).
0
- # Each action will be tested against the formats listed here.
0
+ # Each action will be tested against the formats listed here. The special value
0
+ # of :all will test all of the supported formats.
0
           #
0
           # Example:
0
           # resource.actions = [:html, :xml]
0
@@ -214,6 +217,10 @@ module ThoughtBot # :nodoc:
0
           end
0
 
0
           def normalize!(target) # :nodoc:
0
+ @denied.actions = VALID_ACTIONS if @denied.actions == :all
0
+ @actions = VALID_ACTIONS if @actions == :all
0
+ @formats = VALID_FORMATS if @formats == :all
0
+
0
             @denied.actions = @denied.actions.map(&:to_sym)
0
             @actions = @actions.map(&:to_sym)
0
             @formats = @formats.map(&:to_sym)

Comments

    No one has commented yet.