summaryrefslogtreecommitdiffstats
path: root/test/functional/wiki_controller_test.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2012-11-24 12:27:00 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2012-11-24 12:27:00 +0000
commit29fc292b18de447831e11cb5265495e0107f08e3 (patch)
tree23cdd92fea46e063c7bf451f9994618588537406 /test/functional/wiki_controller_test.rb
parent845d7bc64579b41ed2f038a47ba7444571b48787 (diff)
downloadredmine-29fc292b18de447831e11cb5265495e0107f08e3.tar.gz
redmine-29fc292b18de447831e11cb5265495e0107f08e3.zip
Respond with 404 instead of 500 when requesting a wiki diff with invalid versions (#12434).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10877 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/functional/wiki_controller_test.rb')
-rw-r--r--test/functional/wiki_controller_test.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/functional/wiki_controller_test.rb b/test/functional/wiki_controller_test.rb
index 98fc20038..3673c7622 100644
--- a/test/functional/wiki_controller_test.rb
+++ b/test/functional/wiki_controller_test.rb
@@ -552,6 +552,16 @@ class WikiControllerTest < ActionController::TestCase
assert_select 'span.diff_in', :text => 'Line added'
end
+ def test_diff_with_invalid_version_should_respond_with_404
+ get :diff, :project_id => 1, :id => 'CookBook_documentation', :version => '99'
+ assert_response 404
+ end
+
+ def test_diff_with_invalid_version_from_should_respond_with_404
+ get :diff, :project_id => 1, :id => 'CookBook_documentation', :version => '99', :version_from => '98'
+ assert_response 404
+ end
+
def test_annotate
get :annotate, :project_id => 1, :id => 'CookBook_documentation', :version => 2
assert_response :success
@@ -576,6 +586,11 @@ class WikiControllerTest < ActionController::TestCase
}
end
+ def test_annotate_with_invalid_version_should_respond_with_404
+ get :annotate, :project_id => 1, :id => 'CookBook_documentation', :version => '99'
+ assert_response 404
+ end
+
def test_get_rename
@request.session[:user_id] = 2
get :rename, :project_id => 1, :id => 'Another_page'