@@ -248,9 +248,10 @@ defmodule Phoenix.HTML.FormTest do
248248
249249 describe "options_for_select/2" do
250250 test "simple" do
251- assert options_for_select ( ~w ( value novalue) , "novalue" ) |> safe_to_string ( ) ==
251+ assert options_for_select ( [ " value" , " novalue" , nil ] , "novalue" ) |> safe_to_string ( ) ==
252252 ~s( <option value="value">value</option>) <>
253- ~s( <option selected value="novalue">novalue</option>)
253+ ~s( <option selected value="novalue">novalue</option>) <>
254+ ~s( <option value=""></option>)
254255
255256 assert options_for_select ( [ "value" , :hr , "novalue" ] , "novalue" ) |> safe_to_string ( ) ==
256257 ~s( <option value="value">value</option>) <>
@@ -261,14 +262,16 @@ defmodule Phoenix.HTML.FormTest do
261262 [
262263 [ value: "value" , key: "Value" , disabled: true ] ,
263264 :hr ,
264- [ value: "novalue" , key: "No Value" ]
265+ [ value: "novalue" , key: "No Value" ] ,
266+ [ value: nil , key: nil ]
265267 ] ,
266268 "novalue"
267269 )
268270 |> safe_to_string ( ) ==
269271 ~s( <option disabled value="value">Value</option>) <>
270272 ~s( <hr/>) <>
271- ~s( <option selected value="novalue">No Value</option>)
273+ ~s( <option selected value="novalue">No Value</option>) <>
274+ ~s( <option value=""></option>)
272275
273276 assert options_for_select ( ~w( value novalue) , [ "value" , "novalue" ] ) |> safe_to_string ( ) ==
274277 ~s( <option selected value="value">value</option>) <>
0 commit comments