]> source.dussan.org Git - redmine.git/commitdiff
Adds tests for when showing/deleting an invalid issue.
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Mon, 3 Dec 2012 22:29:59 +0000 (22:29 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Mon, 3 Dec 2012 22:29:59 +0000 (22:29 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10937 e93f8b46-1217-0410-a6f0-8f06a7374b81

test/functional/issues_controller_test.rb

index 7efaa22e5e0e1c0ec44502b907dca7e39e4a3469..4a69019a9a903c62dcbfd31283bedcc48dc81459 100644 (file)
@@ -1405,6 +1405,11 @@ class IssuesControllerTest < ActionController::TestCase
     assert @response.body.starts_with?('%PDF')
   end
 
+  def test_show_invalid_should_respond_with_404
+    get :show, :id => 999
+    assert_response 404
+  end
+
   def test_get_new
     @request.session[:user_id] = 2
     get :new, :project_id => 1, :tracker_id => 1
@@ -3813,6 +3818,14 @@ class IssuesControllerTest < ActionController::TestCase
     assert_response 302
   end
 
+  def test_destroy_invalid_should_respond_with_404
+    @request.session[:user_id] = 2
+    assert_no_difference 'Issue.count' do
+      delete :destroy, :id => 999
+    end
+    assert_response 404
+  end
+
   def test_default_search_scope
     get :index
     assert_tag :div, :attributes => {:id => 'quick-search'},