if grouped.keys.size > 1
grouped_options_for_select(grouped, selected && selected.id)
else
- options_for_select(grouped.values.first, selected && selected.id)
+ options_for_select((grouped.values.first || []), selected && selected.id)
end
end
def test_format_version_name_for_system_version
assert_equal "OnlineStore - Systemwide visible version", format_version_name(Version.find(7))
end
+
+ def test_version_options_for_select_with_no_versions
+ assert_equal '', version_options_for_select([])
+ assert_equal '<option value="1" selected="selected">0.1</option>', version_options_for_select([], Version.find(1))
+ end
end