diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2012-03-10 13:57:31 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2012-03-10 13:57:31 +0000 |
commit | 934dd07fa738218aa296e907d89fb50fd2cc84c1 (patch) | |
tree | 88067a126a57ed3f99d0f08cac33e6db53ad78c0 /test | |
parent | 33cb9c87a9fabe56cf15d125ec1221807a08cf60 (diff) | |
download | redmine-934dd07fa738218aa296e907d89fb50fd2cc84c1.tar.gz redmine-934dd07fa738218aa296e907d89fb50fd2cc84c1.zip |
Adds a test for #9076.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@9174 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test')
-rw-r--r-- | test/functional/issues_controller_test.rb | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/test/functional/issues_controller_test.rb b/test/functional/issues_controller_test.rb index 9a52e9c8b..c111f2bf2 100644 --- a/test/functional/issues_controller_test.rb +++ b/test/functional/issues_controller_test.rb @@ -1283,6 +1283,25 @@ class IssuesControllerTest < ActionController::TestCase } end + def test_get_new_should_prefill_the_form_from_params + @request.session[:user_id] = 2 + get :new, :project_id => 1, + :issue => {:tracker_id => 3, :description => 'Prefilled', :custom_field_values => {'2' => 'Custom field value'}} + + issue = assigns(:issue) + assert_equal 3, issue.tracker_id + assert_equal 'Prefilled', issue.description + assert_equal 'Custom field value', issue.custom_field_value(2) + + assert_tag 'select', + :attributes => {:name => 'issue[tracker_id]'}, + :child => {:tag => 'option', :attributes => {:value => '3', :selected => 'selected'}} + assert_tag 'textarea', + :attributes => {:name => 'issue[description]'}, :content => 'Prefilled' + assert_tag 'input', + :attributes => {:name => 'issue[custom_field_values][2]', :value => 'Custom field value'} + end + def test_get_new_without_tracker_id @request.session[:user_id] = 2 get :new, :project_id => 1 |