From: Jean-Philippe Lang Date: Fri, 29 Jul 2011 16:04:38 +0000 (+0000) Subject: Test that forms are well-formed for issue attachment upload. X-Git-Tag: 1.3.0~1621 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=642d3b6512cf0579c73d787b010c51ec26ab0313;p=redmine.git Test that forms are well-formed for issue attachment upload. git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@6322 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- diff --git a/test/functional/issues_controller_test.rb b/test/functional/issues_controller_test.rb index c1bc17ffc..84c7e8b6c 100644 --- a/test/functional/issues_controller_test.rb +++ b/test/functional/issues_controller_test.rb @@ -354,6 +354,18 @@ class IssuesControllerTest < ActionController::TestCase assert_no_tag :option, :attributes => {:value => '15'}, :parent => {:tag => 'select', :attributes => {:id => 'issue_priority_id'} } end + + def test_update_form_should_allow_attachment_upload + @request.session[:user_id] = 2 + get :show, :id => 1 + + assert_tag :tag => 'form', + :attributes => {:id => 'issue-form', :method => 'post', :enctype => 'multipart/form-data'}, + :descendant => { + :tag => 'input', + :attributes => {:type => 'file', :name => 'attachments[1][file]'} + } + end def test_show_should_deny_anonymous_access_without_permission Role.anonymous.remove_permission!(:view_issues) @@ -462,6 +474,18 @@ class IssuesControllerTest < ActionController::TestCase assert_no_tag :option, :attributes => {:value => '15'}, :parent => {:tag => 'select', :attributes => {:id => 'issue_priority_id'} } end + + def test_get_new_form_should_allow_attachment_upload + @request.session[:user_id] = 2 + get :new, :project_id => 1, :tracker_id => 1 + + assert_tag :tag => 'form', + :attributes => {:id => 'issue-form', :method => 'post', :enctype => 'multipart/form-data'}, + :descendant => { + :tag => 'input', + :attributes => {:type => 'file', :name => 'attachments[1][file]'} + } + end def test_get_new_without_tracker_id @request.session[:user_id] = 2