summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2012-03-10 18:37:51 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2012-03-10 18:37:51 +0000
commita74e86ddce874a338b7aacd6fb243e394052c32c (patch)
treecbaf46c8ad32f93cbec5b5dc6aa6a119892c3721 /test
parentdbda62849d2126844d9a9faaaf76d091934225d5 (diff)
downloadredmine-a74e86ddce874a338b7aacd6fb243e394052c32c.tar.gz
redmine-a74e86ddce874a338b7aacd6fb243e394052c32c.zip
Additional tests for IssuesController.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@9177 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 c111f2bf2..199e9317e 100644
--- a/test/functional/issues_controller_test.rb
+++ b/test/functional/issues_controller_test.rb
@@ -531,6 +531,21 @@ class IssuesControllerTest < ActionController::TestCase
assert_equal 'application/pdf', @response.content_type
end
+ def test_index_atom
+ get :index, :project_id => 'ecookbook', :format => 'atom'
+ assert_response :success
+ assert_template 'common/feed'
+
+ assert_tag :tag => 'link', :parent => {:tag => 'feed', :parent => nil },
+ :attributes => {:rel => 'self', :href => 'http://test.host/projects/ecookbook/issues.atom'}
+ assert_tag :tag => 'link', :parent => {:tag => 'feed', :parent => nil },
+ :attributes => {:rel => 'alternate', :href => 'http://test.host/projects/ecookbook/issues'}
+
+ assert_tag :tag => 'entry', :child => {
+ :tag => 'link',
+ :attributes => {:href => 'http://test.host/issues/1'}}
+ end
+
def test_index_sort
get :index, :sort => 'tracker,id:desc'
assert_response :success
@@ -2951,6 +2966,15 @@ class IssuesControllerTest < ActionController::TestCase
assert_redirected_to :controller => 'issues', :action => 'index', :project_id => Project.find(1).identifier
end
+ def test_bulk_update_with_failure_should_set_flash
+ @request.session[:user_id] = 2
+ Issue.update_all("subject = ''", "id = 2") # Make it invalid
+ post :bulk_update, :ids => [1, 2], :issue => {:priority_id => 6}
+
+ assert_redirected_to :controller => 'issues', :action => 'index', :project_id => 'ecookbook'
+ assert_equal 'Failed to save 1 issue(s) on 2 selected: #2.', flash[:error]
+ end
+
def test_bulk_copy_to_another_project
@request.session[:user_id] = 2
assert_difference 'Issue.count', 2 do