diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2009-12-06 11:09:12 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2009-12-06 11:09:12 +0000 |
commit | a2b4bb0dfb932b4e93efe4c85ac7f65033b87f7a (patch) | |
tree | a5c2ce13916bcb349ac2c1aa5fffe6d8b64f7a58 /test/functional/projects_controller_test.rb | |
parent | 8f33c6589d67493cad0c03aad7204a06420f8829 (diff) | |
download | redmine-a2b4bb0dfb932b4e93efe4c85ac7f65033b87f7a.tar.gz redmine-a2b4bb0dfb932b4e93efe4c85ac7f65033b87f7a.zip |
Ability to add a new version from the issue form (#4315).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@3126 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/functional/projects_controller_test.rb')
-rw-r--r-- | test/functional/projects_controller_test.rb | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/test/functional/projects_controller_test.rb b/test/functional/projects_controller_test.rb index 21223fcbd..81c3d8b1c 100644 --- a/test/functional/projects_controller_test.rb +++ b/test/functional/projects_controller_test.rb @@ -242,6 +242,29 @@ class ProjectsControllerTest < ActionController::TestCase ) end + def test_add_version + @request.session[:user_id] = 2 # manager + assert_difference 'Version.count' do + post :add_version, :id => '1', :version => {:name => 'test_add_version'} + end + assert_redirected_to '/projects/ecookbook/settings/versions' + version = Version.find_by_name('test_add_version') + assert_not_nil version + assert_equal 1, version.project_id + end + + def test_add_version_from_issue_form + @request.session[:user_id] = 2 # manager + assert_difference 'Version.count' do + xhr :post, :add_version, :id => '1', :version => {:name => 'test_add_version_from_issue_form'} + end + assert_response :success + assert_select_rjs :replace, 'issue_fixed_version_id' + version = Version.find_by_name('test_add_version_from_issue_form') + assert_not_nil version + assert_equal 1, version.project_id + end + def test_add_issue_category_routing assert_routing( {:method => :get, :path => 'projects/test/categories/new'}, |