diff options
author | Toshi MARUYAMA <marutosijp2@yahoo.co.jp> | 2011-11-06 10:47:45 +0000 |
---|---|---|
committer | Toshi MARUYAMA <marutosijp2@yahoo.co.jp> | 2011-11-06 10:47:45 +0000 |
commit | 0921042bc461a1242ceee8c35462133e093a51e0 (patch) | |
tree | c7f9302ba50eeccd2b838692c1f17a1059042289 /test/functional/wiki_controller_test.rb | |
parent | fe386fe50d4d465e921f11b4a5be266901eb42c3 (diff) | |
download | redmine-0921042bc461a1242ceee8c35462133e093a51e0.tar.gz redmine-0921042bc461a1242ceee8c35462133e093a51e0.zip |
test: functional: wiki: add tests to show html and txt (#401)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@7739 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/functional/wiki_controller_test.rb')
-rw-r--r-- | test/functional/wiki_controller_test.rb | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/test/functional/wiki_controller_test.rb b/test/functional/wiki_controller_test.rb index 5ff365d21..9247dfdb8 100644 --- a/test/functional/wiki_controller_test.rb +++ b/test/functional/wiki_controller_test.rb @@ -494,6 +494,26 @@ class WikiControllerTest < ActionController::TestCase assert_no_tag :tag => 'a', :attributes => { :href => '/projects/1/wiki/CookBook_documentation/edit' } end + def test_show_html + @request.session[:user_id] = 2 + get :show, :project_id => 1, :format => 'html' + assert_response :success + assert_not_nil assigns(:page) + assert_equal 'text/html', @response.content_type + assert_equal 'attachment; filename="CookBook_documentation.html"', + @response.headers['Content-Disposition'] + end + + def test_show_txt + @request.session[:user_id] = 2 + get :show, :project_id => 1, :format => 'txt' + assert_response :success + assert_not_nil assigns(:page) + assert_equal 'text/plain', @response.content_type + assert_equal 'attachment; filename="CookBook_documentation.txt"', + @response.headers['Content-Disposition'] + end + def test_edit_unprotected_page # Non members can edit unprotected wiki pages @request.session[:user_id] = 4 |