Skip to content
This repository
Browse code

Fixed tests

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@786 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
commit 02df588cf79cc3738278aea501a2d219afb783b5 1 parent b3bfe13
David Heinemeier Hansson authored February 24, 2005
2  actionpack/test/controller/redirect_test.rb
@@ -31,6 +31,6 @@ def test_simple_redirect
31 31
 
32 32
   def test_redirect_with_method_reference_and_parameters
33 33
     get :method_redirect
34  
-    assert_redirect_url "http://test.host/redirect/dashboard?message=hello&id=1"
  34
+    assert_redirect_url "http://test.host/redirect/dashboard/1?message=hello"
35 35
   end
36 36
 end
128  actionpack/test/template/form_options_helper_test.rb
@@ -129,67 +129,67 @@ def test_html_option_groups_from_collection
129 129
 
130 130
   def test_time_zone_options_no_parms
131 131
     opts = time_zone_options_for_select
132  
-    assert_equal "<option>A</option>\n" +
133  
-                 "<option>B</option>\n" +
134  
-                 "<option>C</option>\n" +
135  
-                 "<option>D</option>\n" +
136  
-                 "<option>E</option>",
  132
+    assert_equal "<option value=\"A\">A</option>\n" +
  133
+                 "<option value=\"B\">B</option>\n" +
  134
+                 "<option value=\"C\">C</option>\n" +
  135
+                 "<option value=\"D\">D</option>\n" +
  136
+                 "<option value=\"E\">E</option>",
137 137
                  opts
138 138
   end
139 139
 
140 140
   def test_time_zone_options_with_selected
141  
-    opts = time_zone_options_for_select( TimeZone.new( "D" ) )
142  
-    assert_equal "<option>A</option>\n" +
143  
-                 "<option>B</option>\n" +
144  
-                 "<option>C</option>\n" +
145  
-                 "<option selected=\"selected\">D</option>\n" +
146  
-                 "<option>E</option>",
  141
+    opts = time_zone_options_for_select( "D" )
  142
+    assert_equal "<option value=\"A\">A</option>\n" +
  143
+                 "<option value=\"B\">B</option>\n" +
  144
+                 "<option value=\"C\">C</option>\n" +
  145
+                 "<option value=\"D\" selected=\"selected\">D</option>\n" +
  146
+                 "<option value=\"E\">E</option>",
147 147
                  opts
148 148
   end
149 149
 
150 150
   def test_time_zone_options_with_unknown_selected
151  
-    opts = time_zone_options_for_select( TimeZone.new( "K" ) )
152  
-    assert_equal "<option>A</option>\n" +
153  
-                 "<option>B</option>\n" +
154  
-                 "<option>C</option>\n" +
155  
-                 "<option>D</option>\n" +
156  
-                 "<option>E</option>",
  151
+    opts = time_zone_options_for_select( "K" )
  152
+    assert_equal "<option value=\"A\">A</option>\n" +
  153
+                 "<option value=\"B\">B</option>\n" +
  154
+                 "<option value=\"C\">C</option>\n" +
  155
+                 "<option value=\"D\">D</option>\n" +
  156
+                 "<option value=\"E\">E</option>",
157 157
                  opts
158 158
   end
159 159
 
160 160
   def test_time_zone_options_with_priority_zones
161 161
     zones = [ TimeZone.new( "B" ), TimeZone.new( "E" ) ]
162 162
     opts = time_zone_options_for_select( nil, zones )
163  
-    assert_equal "<option>B</option>\n" +
164  
-                 "<option>E</option>" +
  163
+    assert_equal "<option value=\"B\">B</option>\n" +
  164
+                 "<option value=\"E\">E</option>" +
165 165
                  "<option>-------------</option>\n" +
166  
-                 "<option>A</option>\n" +
167  
-                 "<option>C</option>\n" +
168  
-                 "<option>D</option>",
  166
+                 "<option value=\"A\">A</option>\n" +
  167
+                 "<option value=\"C\">C</option>\n" +
  168
+                 "<option value=\"D\">D</option>",
169 169
                  opts
170 170
   end
171 171
 
172 172
   def test_time_zone_options_with_selected_priority_zones
173 173
     zones = [ TimeZone.new( "B" ), TimeZone.new( "E" ) ]
174  
-    opts = time_zone_options_for_select( TimeZone.new("E"), zones )
175  
-    assert_equal "<option>B</option>\n" +
176  
-                 "<option selected=\"selected\">E</option>" +
  174
+    opts = time_zone_options_for_select( "E", zones )
  175
+    assert_equal "<option value=\"B\">B</option>\n" +
  176
+                 "<option value=\"E\" selected=\"selected\">E</option>" +
177 177
                  "<option>-------------</option>\n" +
178  
-                 "<option>A</option>\n" +
179  
-                 "<option>C</option>\n" +
180  
-                 "<option>D</option>",
  178
+                 "<option value=\"A\">A</option>\n" +
  179
+                 "<option value=\"C\">C</option>\n" +
  180
+                 "<option value=\"D\">D</option>",
181 181
                  opts
182 182
   end
183 183
 
184 184
   def test_time_zone_options_with_unselected_priority_zones
185 185
     zones = [ TimeZone.new( "B" ), TimeZone.new( "E" ) ]
186  
-    opts = time_zone_options_for_select( TimeZone.new("C"), zones )
187  
-    assert_equal "<option>B</option>\n" +
188  
-                 "<option>E</option>" +
  186
+    opts = time_zone_options_for_select( "C", zones )
  187
+    assert_equal "<option value=\"B\">B</option>\n" +
  188
+                 "<option value=\"E\">E</option>" +
189 189
                  "<option>-------------</option>\n" +
190  
-                 "<option>A</option>\n" +
191  
-                 "<option selected=\"selected\">C</option>\n" +
192  
-                 "<option>D</option>",
  190
+                 "<option value=\"A\">A</option>\n" +
  191
+                 "<option value=\"C\" selected=\"selected\">C</option>\n" +
  192
+                 "<option value=\"D\">D</option>",
193 193
                  opts
194 194
   end
195 195
 
@@ -253,72 +253,72 @@ def test_country_select
253 253
   end
254 254
 
255 255
   def test_time_zone_select
256  
-    @firm = Firm.new( TimeZone.new( "D" ) )
  256
+    @firm = Firm.new("D")
257 257
     html = time_zone_select( "firm", "time_zone" )
258 258
     assert_equal "<select id=\"firm_time_zone\" name=\"firm[time_zone]\">" +
259  
-                 "<option>A</option>\n" +
260  
-                 "<option>B</option>\n" +
261  
-                 "<option>C</option>\n" +
262  
-                 "<option selected=\"selected\">D</option>\n" +
263  
-                 "<option>E</option>" +
  259
+                 "<option value=\"A\">A</option>\n" +
  260
+                 "<option value=\"B\">B</option>\n" +
  261
+                 "<option value=\"C\">C</option>\n" +
  262
+                 "<option value=\"D\" selected=\"selected\">D</option>\n" +
  263
+                 "<option value=\"E\">E</option>" +
264 264
                  "</select>",
265 265
                  html
266 266
   end
267 267
 
268 268
   def test_time_zone_select_with_blank
269  
-    @firm = Firm.new(TimeZone.new("D"))
  269
+    @firm = Firm.new("D")
270 270
     html = time_zone_select("firm", "time_zone", nil, :include_blank => true)
271 271
     assert_equal "<select id=\"firm_time_zone\" name=\"firm[time_zone]\">" +
272 272
                  "<option></option>\n" +
273  
-                 "<option>A</option>\n" +
274  
-                 "<option>B</option>\n" +
275  
-                 "<option>C</option>\n" +
276  
-                 "<option selected=\"selected\">D</option>\n" +
277  
-                 "<option>E</option>" +
  273
+                 "<option value=\"A\">A</option>\n" +
  274
+                 "<option value=\"B\">B</option>\n" +
  275
+                 "<option value=\"C\">C</option>\n" +
  276
+                 "<option value=\"D\" selected=\"selected\">D</option>\n" +
  277
+                 "<option value=\"E\">E</option>" +
278 278
                  "</select>",
279 279
                  html
280 280
   end
281 281
 
282 282
   def test_time_zone_select_with_style
283  
-    @firm = Firm.new(TimeZone.new("D"))
  283
+    @firm = Firm.new("D")
284 284
     html = time_zone_select("firm", "time_zone", nil, {},
285 285
       "style" => "color: red")
286 286
     assert_equal "<select id=\"firm_time_zone\" name=\"firm[time_zone]\" style=\"color: red\">" +
287  
-                 "<option>A</option>\n" +
288  
-                 "<option>B</option>\n" +
289  
-                 "<option>C</option>\n" +
290  
-                 "<option selected=\"selected\">D</option>\n" +
291  
-                 "<option>E</option>" +
  287
+                 "<option value=\"A\">A</option>\n" +
  288
+                 "<option value=\"B\">B</option>\n" +
  289
+                 "<option value=\"C\">C</option>\n" +
  290
+                 "<option value=\"D\" selected=\"selected\">D</option>\n" +
  291
+                 "<option value=\"E\">E</option>" +
292 292
                  "</select>",
293 293
                  html
294 294
   end
295 295
 
296 296
   def test_time_zone_select_with_blank_and_style
297  
-    @firm = Firm.new(TimeZone.new("D"))
  297
+    @firm = Firm.new("D")
298 298
     html = time_zone_select("firm", "time_zone", nil,
299 299
       { :include_blank => true }, "style" => "color: red")
300 300
     assert_equal "<select id=\"firm_time_zone\" name=\"firm[time_zone]\" style=\"color: red\">" +
301 301
                  "<option></option>\n" +
302  
-                 "<option>A</option>\n" +
303  
-                 "<option>B</option>\n" +
304  
-                 "<option>C</option>\n" +
305  
-                 "<option selected=\"selected\">D</option>\n" +
306  
-                 "<option>E</option>" +
  302
+                 "<option value=\"A\">A</option>\n" +
  303
+                 "<option value=\"B\">B</option>\n" +
  304
+                 "<option value=\"C\">C</option>\n" +
  305
+                 "<option value=\"D\" selected=\"selected\">D</option>\n" +
  306
+                 "<option value=\"E\">E</option>" +
307 307
                  "</select>",
308 308
                  html
309 309
   end
310 310
 
311 311
   def test_time_zone_select_with_priority_zones
312  
-    @firm = Firm.new(TimeZone.new("D"))
  312
+    @firm = Firm.new("D")
313 313
     zones = [ TimeZone.new("A"), TimeZone.new("D") ]
314 314
     html = time_zone_select("firm", "time_zone", zones )
315 315
     assert_equal "<select id=\"firm_time_zone\" name=\"firm[time_zone]\">" +
316  
-                 "<option>A</option>\n" +
317  
-                 "<option selected=\"selected\">D</option>" +
  316
+                 "<option value=\"A\">A</option>\n" +
  317
+                 "<option value=\"D\" selected=\"selected\">D</option>" +
318 318
                  "<option>-------------</option>\n" +
319  
-                 "<option>B</option>\n" +
320  
-                 "<option>C</option>\n" +
321  
-                 "<option>E</option>" +
  319
+                 "<option value=\"B\">B</option>\n" +
  320
+                 "<option value=\"C\">C</option>\n" +
  321
+                 "<option value=\"E\">E</option>" +
322 322
                  "</select>",
323 323
                  html
324 324
   end

0 notes on commit 02df588

Please sign in to comment.
Something went wrong with that request. Please try again.