From 9b4d29dc0d0c5932f70d420541f22cb242a10518 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Fri, 27 Jul 2012 19:41:36 +0000 Subject: [PATCH] Do not propose non-assignable version (#11506). git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10087 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/helpers/projects_helper.rb | 4 ---- test/functional/versions_controller_test.rb | 1 + test/unit/helpers/projects_helper_test.rb | 2 +- 3 files changed, 2 insertions(+), 5 deletions(-) diff --git a/app/helpers/projects_helper.rb b/app/helpers/projects_helper.rb index 162b25f1f..9d538c966 100644 --- a/app/helpers/projects_helper.rb +++ b/app/helpers/projects_helper.rb @@ -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) diff --git a/test/functional/versions_controller_test.rb b/test/functional/versions_controller_test.rb index 7ca9bf06b..87fd966b6 100644 --- a/test/functional/versions_controller_test.rb +++ b/test/functional/versions_controller_test.rb @@ -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 diff --git a/test/unit/helpers/projects_helper_test.rb b/test/unit/helpers/projects_helper_test.rb index 3be76e8d6..68e0635aa 100644 --- a/test/unit/helpers/projects_helper_test.rb +++ b/test/unit/helpers/projects_helper_test.rb @@ -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 '', version_options_for_select([], Version.find(1)) + assert_equal '', version_options_for_select([], Version.find(1)) end end -- 2.39.5