]> source.dussan.org Git - redmine.git/commitdiff
Do not propose non-assignable version (#11506).
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Fri, 27 Jul 2012 19:41:36 +0000 (19:41 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Fri, 27 Jul 2012 19:41:36 +0000 (19:41 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10087 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/helpers/projects_helper.rb
test/functional/versions_controller_test.rb
test/unit/helpers/projects_helper_test.rb

index 162b25f1fb47aa061a69d74f1d73a66144d5d356..9d538c966a8687b0062a9897eaab1bf4c6354f12 100644 (file)
@@ -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)
index 7ca9bf06b4d64a12039b8d5896e6fd414ae0a1a2..87fd966b637091211168fd5e44656a3ac2450184 100644 (file)
@@ -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
index 3be76e8d67ab015bcdf667346920a7c5a67615a4..68e0635aab6dc5aa4e6533b33083797ea3c65aad 100644 (file)
@@ -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