##// END OF EJS Templates
Additional tests for IssuesController....
Jean-Philippe Lang -
r9057:a74e86ddce87
parent child
Show More
@@ -531,6 +531,21 class IssuesControllerTest < ActionController::TestCase
531 531 assert_equal 'application/pdf', @response.content_type
532 532 end
533 533
534 def test_index_atom
535 get :index, :project_id => 'ecookbook', :format => 'atom'
536 assert_response :success
537 assert_template 'common/feed'
538
539 assert_tag :tag => 'link', :parent => {:tag => 'feed', :parent => nil },
540 :attributes => {:rel => 'self', :href => 'http://test.host/projects/ecookbook/issues.atom'}
541 assert_tag :tag => 'link', :parent => {:tag => 'feed', :parent => nil },
542 :attributes => {:rel => 'alternate', :href => 'http://test.host/projects/ecookbook/issues'}
543
544 assert_tag :tag => 'entry', :child => {
545 :tag => 'link',
546 :attributes => {:href => 'http://test.host/issues/1'}}
547 end
548
534 549 def test_index_sort
535 550 get :index, :sort => 'tracker,id:desc'
536 551 assert_response :success
@@ -2951,6 +2966,15 class IssuesControllerTest < ActionController::TestCase
2951 2966 assert_redirected_to :controller => 'issues', :action => 'index', :project_id => Project.find(1).identifier
2952 2967 end
2953 2968
2969 def test_bulk_update_with_failure_should_set_flash
2970 @request.session[:user_id] = 2
2971 Issue.update_all("subject = ''", "id = 2") # Make it invalid
2972 post :bulk_update, :ids => [1, 2], :issue => {:priority_id => 6}
2973
2974 assert_redirected_to :controller => 'issues', :action => 'index', :project_id => 'ecookbook'
2975 assert_equal 'Failed to save 1 issue(s) on 2 selected: #2.', flash[:error]
2976 end
2977
2954 2978 def test_bulk_copy_to_another_project
2955 2979 @request.session[:user_id] = 2
2956 2980 assert_difference 'Issue.count', 2 do
General Comments 0
You need to be logged in to leave comments. Login now