Permalink
Browse files

Fixed tests

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@786 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
1 parent b3bfe13 commit 02df588cf79cc3738278aea501a2d219afb783b5 @dhh dhh committed Feb 24, 2005
Showing with 65 additions and 65 deletions.
  1. +1 −1 actionpack/test/controller/redirect_test.rb
  2. +64 −64 actionpack/test/template/form_options_helper_test.rb
View
2 actionpack/test/controller/redirect_test.rb
@@ -31,6 +31,6 @@ def test_simple_redirect
def test_redirect_with_method_reference_and_parameters
get :method_redirect
- assert_redirect_url "http://test.host/redirect/dashboard?message=hello&id=1"
+ assert_redirect_url "http://test.host/redirect/dashboard/1?message=hello"
end
end
View
128 actionpack/test/template/form_options_helper_test.rb
@@ -129,67 +129,67 @@ def test_html_option_groups_from_collection
def test_time_zone_options_no_parms
opts = time_zone_options_for_select
- assert_equal "<option>A</option>\n" +
- "<option>B</option>\n" +
- "<option>C</option>\n" +
- "<option>D</option>\n" +
- "<option>E</option>",
+ assert_equal "<option value=\"A\">A</option>\n" +
+ "<option value=\"B\">B</option>\n" +
+ "<option value=\"C\">C</option>\n" +
+ "<option value=\"D\">D</option>\n" +
+ "<option value=\"E\">E</option>",
opts
end
def test_time_zone_options_with_selected
- opts = time_zone_options_for_select( TimeZone.new( "D" ) )
- assert_equal "<option>A</option>\n" +
- "<option>B</option>\n" +
- "<option>C</option>\n" +
- "<option selected=\"selected\">D</option>\n" +
- "<option>E</option>",
+ opts = time_zone_options_for_select( "D" )
+ assert_equal "<option value=\"A\">A</option>\n" +
+ "<option value=\"B\">B</option>\n" +
+ "<option value=\"C\">C</option>\n" +
+ "<option value=\"D\" selected=\"selected\">D</option>\n" +
+ "<option value=\"E\">E</option>",
opts
end
def test_time_zone_options_with_unknown_selected
- opts = time_zone_options_for_select( TimeZone.new( "K" ) )
- assert_equal "<option>A</option>\n" +
- "<option>B</option>\n" +
- "<option>C</option>\n" +
- "<option>D</option>\n" +
- "<option>E</option>",
+ opts = time_zone_options_for_select( "K" )
+ assert_equal "<option value=\"A\">A</option>\n" +
+ "<option value=\"B\">B</option>\n" +
+ "<option value=\"C\">C</option>\n" +
+ "<option value=\"D\">D</option>\n" +
+ "<option value=\"E\">E</option>",
opts
end
def test_time_zone_options_with_priority_zones
zones = [ TimeZone.new( "B" ), TimeZone.new( "E" ) ]
opts = time_zone_options_for_select( nil, zones )
- assert_equal "<option>B</option>\n" +
- "<option>E</option>" +
+ assert_equal "<option value=\"B\">B</option>\n" +
+ "<option value=\"E\">E</option>" +
"<option>-------------</option>\n" +
- "<option>A</option>\n" +
- "<option>C</option>\n" +
- "<option>D</option>",
+ "<option value=\"A\">A</option>\n" +
+ "<option value=\"C\">C</option>\n" +
+ "<option value=\"D\">D</option>",
opts
end
def test_time_zone_options_with_selected_priority_zones
zones = [ TimeZone.new( "B" ), TimeZone.new( "E" ) ]
- opts = time_zone_options_for_select( TimeZone.new("E"), zones )
- assert_equal "<option>B</option>\n" +
- "<option selected=\"selected\">E</option>" +
+ opts = time_zone_options_for_select( "E", zones )
+ assert_equal "<option value=\"B\">B</option>\n" +
+ "<option value=\"E\" selected=\"selected\">E</option>" +
"<option>-------------</option>\n" +
- "<option>A</option>\n" +
- "<option>C</option>\n" +
- "<option>D</option>",
+ "<option value=\"A\">A</option>\n" +
+ "<option value=\"C\">C</option>\n" +
+ "<option value=\"D\">D</option>",
opts
end
def test_time_zone_options_with_unselected_priority_zones
zones = [ TimeZone.new( "B" ), TimeZone.new( "E" ) ]
- opts = time_zone_options_for_select( TimeZone.new("C"), zones )
- assert_equal "<option>B</option>\n" +
- "<option>E</option>" +
+ opts = time_zone_options_for_select( "C", zones )
+ assert_equal "<option value=\"B\">B</option>\n" +
+ "<option value=\"E\">E</option>" +
"<option>-------------</option>\n" +
- "<option>A</option>\n" +
- "<option selected=\"selected\">C</option>\n" +
- "<option>D</option>",
+ "<option value=\"A\">A</option>\n" +
+ "<option value=\"C\" selected=\"selected\">C</option>\n" +
+ "<option value=\"D\">D</option>",
opts
end
@@ -253,72 +253,72 @@ def test_country_select
end
def test_time_zone_select
- @firm = Firm.new( TimeZone.new( "D" ) )
+ @firm = Firm.new("D")
html = time_zone_select( "firm", "time_zone" )
assert_equal "<select id=\"firm_time_zone\" name=\"firm[time_zone]\">" +
- "<option>A</option>\n" +
- "<option>B</option>\n" +
- "<option>C</option>\n" +
- "<option selected=\"selected\">D</option>\n" +
- "<option>E</option>" +
+ "<option value=\"A\">A</option>\n" +
+ "<option value=\"B\">B</option>\n" +
+ "<option value=\"C\">C</option>\n" +
+ "<option value=\"D\" selected=\"selected\">D</option>\n" +
+ "<option value=\"E\">E</option>" +
"</select>",
html
end
def test_time_zone_select_with_blank
- @firm = Firm.new(TimeZone.new("D"))
+ @firm = Firm.new("D")
html = time_zone_select("firm", "time_zone", nil, :include_blank => true)
assert_equal "<select id=\"firm_time_zone\" name=\"firm[time_zone]\">" +
"<option></option>\n" +
- "<option>A</option>\n" +
- "<option>B</option>\n" +
- "<option>C</option>\n" +
- "<option selected=\"selected\">D</option>\n" +
- "<option>E</option>" +
+ "<option value=\"A\">A</option>\n" +
+ "<option value=\"B\">B</option>\n" +
+ "<option value=\"C\">C</option>\n" +
+ "<option value=\"D\" selected=\"selected\">D</option>\n" +
+ "<option value=\"E\">E</option>" +
"</select>",
html
end
def test_time_zone_select_with_style
- @firm = Firm.new(TimeZone.new("D"))
+ @firm = Firm.new("D")
html = time_zone_select("firm", "time_zone", nil, {},
"style" => "color: red")
assert_equal "<select id=\"firm_time_zone\" name=\"firm[time_zone]\" style=\"color: red\">" +
- "<option>A</option>\n" +
- "<option>B</option>\n" +
- "<option>C</option>\n" +
- "<option selected=\"selected\">D</option>\n" +
- "<option>E</option>" +
+ "<option value=\"A\">A</option>\n" +
+ "<option value=\"B\">B</option>\n" +
+ "<option value=\"C\">C</option>\n" +
+ "<option value=\"D\" selected=\"selected\">D</option>\n" +
+ "<option value=\"E\">E</option>" +
"</select>",
html
end
def test_time_zone_select_with_blank_and_style
- @firm = Firm.new(TimeZone.new("D"))
+ @firm = Firm.new("D")
html = time_zone_select("firm", "time_zone", nil,
{ :include_blank => true }, "style" => "color: red")
assert_equal "<select id=\"firm_time_zone\" name=\"firm[time_zone]\" style=\"color: red\">" +
"<option></option>\n" +
- "<option>A</option>\n" +
- "<option>B</option>\n" +
- "<option>C</option>\n" +
- "<option selected=\"selected\">D</option>\n" +
- "<option>E</option>" +
+ "<option value=\"A\">A</option>\n" +
+ "<option value=\"B\">B</option>\n" +
+ "<option value=\"C\">C</option>\n" +
+ "<option value=\"D\" selected=\"selected\">D</option>\n" +
+ "<option value=\"E\">E</option>" +
"</select>",
html
end
def test_time_zone_select_with_priority_zones
- @firm = Firm.new(TimeZone.new("D"))
+ @firm = Firm.new("D")
zones = [ TimeZone.new("A"), TimeZone.new("D") ]
html = time_zone_select("firm", "time_zone", zones )
assert_equal "<select id=\"firm_time_zone\" name=\"firm[time_zone]\">" +
- "<option>A</option>\n" +
- "<option selected=\"selected\">D</option>" +
+ "<option value=\"A\">A</option>\n" +
+ "<option value=\"D\" selected=\"selected\">D</option>" +
"<option>-------------</option>\n" +
- "<option>B</option>\n" +
- "<option>C</option>\n" +
- "<option>E</option>" +
+ "<option value=\"B\">B</option>\n" +
+ "<option value=\"C\">C</option>\n" +
+ "<option value=\"E\">E</option>" +
"</select>",
html
end

0 comments on commit 02df588

Please sign in to comment.