##// END OF EJS Templates
Test that forms are well-formed for issue attachment upload....
Jean-Philippe Lang -
r6202:642d3b6512cf
parent child
Show More
@@ -355,6 +355,18 class IssuesControllerTest < ActionController::TestCase
355 :parent => {:tag => 'select', :attributes => {:id => 'issue_priority_id'} }
355 :parent => {:tag => 'select', :attributes => {:id => 'issue_priority_id'} }
356 end
356 end
357
357
358 def test_update_form_should_allow_attachment_upload
359 @request.session[:user_id] = 2
360 get :show, :id => 1
361
362 assert_tag :tag => 'form',
363 :attributes => {:id => 'issue-form', :method => 'post', :enctype => 'multipart/form-data'},
364 :descendant => {
365 :tag => 'input',
366 :attributes => {:type => 'file', :name => 'attachments[1][file]'}
367 }
368 end
369
358 def test_show_should_deny_anonymous_access_without_permission
370 def test_show_should_deny_anonymous_access_without_permission
359 Role.anonymous.remove_permission!(:view_issues)
371 Role.anonymous.remove_permission!(:view_issues)
360 get :show, :id => 1
372 get :show, :id => 1
@@ -463,6 +475,18 class IssuesControllerTest < ActionController::TestCase
463 :parent => {:tag => 'select', :attributes => {:id => 'issue_priority_id'} }
475 :parent => {:tag => 'select', :attributes => {:id => 'issue_priority_id'} }
464 end
476 end
465
477
478 def test_get_new_form_should_allow_attachment_upload
479 @request.session[:user_id] = 2
480 get :new, :project_id => 1, :tracker_id => 1
481
482 assert_tag :tag => 'form',
483 :attributes => {:id => 'issue-form', :method => 'post', :enctype => 'multipart/form-data'},
484 :descendant => {
485 :tag => 'input',
486 :attributes => {:type => 'file', :name => 'attachments[1][file]'}
487 }
488 end
489
466 def test_get_new_without_tracker_id
490 def test_get_new_without_tracker_id
467 @request.session[:user_id] = 2
491 @request.session[:user_id] = 2
468 get :new, :project_id => 1
492 get :new, :project_id => 1
General Comments 0
You need to be logged in to leave comments. Login now