@@ -771,6 +771,18 class WikiControllerTest < ActionController::TestCase | |||||
771 | assert_tag 'h1', :content => 'CookBook documentation' |
|
771 | assert_tag 'h1', :content => 'CookBook documentation' | |
772 | end |
|
772 | end | |
773 |
|
773 | |||
|
774 | def test_show_versioned_html | |||
|
775 | @request.session[:user_id] = 2 | |||
|
776 | get :show, :project_id => 1, :format => 'html', :version => 2 | |||
|
777 | assert_response :success | |||
|
778 | assert_not_nil assigns(:content) | |||
|
779 | assert_equal 2, assigns(:content).version | |||
|
780 | assert_equal 'text/html', @response.content_type | |||
|
781 | assert_equal 'attachment; filename="CookBook_documentation.html"', | |||
|
782 | @response.headers['Content-Disposition'] | |||
|
783 | assert_tag 'h1', :content => 'CookBook documentation' | |||
|
784 | end | |||
|
785 | ||||
774 | def test_show_txt |
|
786 | def test_show_txt | |
775 | @request.session[:user_id] = 2 |
|
787 | @request.session[:user_id] = 2 | |
776 | get :show, :project_id => 1, :format => 'txt' |
|
788 | get :show, :project_id => 1, :format => 'txt' | |
@@ -782,6 +794,18 class WikiControllerTest < ActionController::TestCase | |||||
782 | assert_include 'h1. CookBook documentation', @response.body |
|
794 | assert_include 'h1. CookBook documentation', @response.body | |
783 | end |
|
795 | end | |
784 |
|
796 | |||
|
797 | def test_show_versioned_txt | |||
|
798 | @request.session[:user_id] = 2 | |||
|
799 | get :show, :project_id => 1, :format => 'txt', :version => 2 | |||
|
800 | assert_response :success | |||
|
801 | assert_not_nil assigns(:content) | |||
|
802 | assert_equal 2, assigns(:content).version | |||
|
803 | assert_equal 'text/plain', @response.content_type | |||
|
804 | assert_equal 'attachment; filename="CookBook_documentation.txt"', | |||
|
805 | @response.headers['Content-Disposition'] | |||
|
806 | assert_include 'h1. CookBook documentation', @response.body | |||
|
807 | end | |||
|
808 | ||||
785 | def test_edit_unprotected_page |
|
809 | def test_edit_unprotected_page | |
786 | # Non members can edit unprotected wiki pages |
|
810 | # Non members can edit unprotected wiki pages | |
787 | @request.session[:user_id] = 4 |
|
811 | @request.session[:user_id] = 4 |
General Comments 0
You need to be logged in to leave comments.
Login now