diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2012-04-06 15:31:06 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2012-04-06 15:31:06 +0000 |
commit | eabbab6e2b543c9ffe574c93d0df19e625802315 (patch) | |
tree | b80f8ec29048bd051d0cdff991d0d5a87d5be865 /test/functional/wiki_controller_test.rb | |
parent | d25defe276071c2258459623f94d2d6b35d9a3fa (diff) | |
download | redmine-eabbab6e2b543c9ffe574c93d0df19e625802315.tar.gz redmine-eabbab6e2b543c9ffe574c93d0df19e625802315.zip |
Adds assertions on the content of a versioned wiki page export (#6941).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@9362 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/functional/wiki_controller_test.rb')
-rw-r--r-- | test/functional/wiki_controller_test.rb | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/test/functional/wiki_controller_test.rb b/test/functional/wiki_controller_test.rb index c95b887a1..54a3f650d 100644 --- a/test/functional/wiki_controller_test.rb +++ b/test/functional/wiki_controller_test.rb @@ -771,6 +771,18 @@ class WikiControllerTest < ActionController::TestCase assert_tag 'h1', :content => 'CookBook documentation' end + def test_show_versioned_html + @request.session[:user_id] = 2 + get :show, :project_id => 1, :format => 'html', :version => 2 + assert_response :success + assert_not_nil assigns(:content) + assert_equal 2, assigns(:content).version + assert_equal 'text/html', @response.content_type + assert_equal 'attachment; filename="CookBook_documentation.html"', + @response.headers['Content-Disposition'] + assert_tag 'h1', :content => 'CookBook documentation' + end + def test_show_txt @request.session[:user_id] = 2 get :show, :project_id => 1, :format => 'txt' @@ -782,6 +794,18 @@ class WikiControllerTest < ActionController::TestCase assert_include 'h1. CookBook documentation', @response.body end + def test_show_versioned_txt + @request.session[:user_id] = 2 + get :show, :project_id => 1, :format => 'txt', :version => 2 + assert_response :success + assert_not_nil assigns(:content) + assert_equal 2, assigns(:content).version + assert_equal 'text/plain', @response.content_type + assert_equal 'attachment; filename="CookBook_documentation.txt"', + @response.headers['Content-Disposition'] + assert_include 'h1. CookBook documentation', @response.body + end + def test_edit_unprotected_page # Non members can edit unprotected wiki pages @request.session[:user_id] = 4 |