Commit debeaaf5 authored by jplang's avatar jplang

Do not propose non-assignable version (#11506).

git-svn-id: https://svn.redmine.org/redmine/trunk@10087 e93f8b46-1217-0410-a6f0-8f06a7374b81
parent d86492f3
......@@ -91,10 +91,6 @@ module ProjectsHelper
versions.each do |version|
grouped[version.project.name] << [version.name, version.id]
end
# Add in the selected
if selected && !versions.include?(selected)
grouped[selected.project.name] << [selected.name, selected.id]
end
if grouped.keys.size > 1
grouped_options_for_select(grouped, selected && selected.id)
......
......@@ -127,6 +127,7 @@ class VersionsControllerTest < ActionController::TestCase
assert_response :success
assert_template 'create'
assert_equal 'text/javascript', response.content_type
assert_include 'test_add_version_from_issue_form', response.body
end
def test_create_from_issue_form_with_failure
......
......@@ -72,6 +72,6 @@ class ProjectsHelperTest < ActionView::TestCase
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))
assert_equal '', version_options_for_select([], Version.find(1))
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment