summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2011-07-29 16:04:38 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2011-07-29 16:04:38 +0000
commit642d3b6512cf0579c73d787b010c51ec26ab0313 (patch)
tree0f73ae79508c380c0d50d3db432389c178963a25 /test
parentb14576c56baefc02e6f4ca7d7fc6ede4800cc473 (diff)
downloadredmine-642d3b6512cf0579c73d787b010c51ec26ab0313.tar.gz
redmine-642d3b6512cf0579c73d787b010c51ec26ab0313.zip
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
Diffstat (limited to 'test')
-rw-r--r--test/functional/issues_controller_test.rb24
1 files changed, 24 insertions, 0 deletions
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