]> source.dussan.org Git - redmine.git/commitdiff
test: functional: wiki: add tests to show html and txt (#401)
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Sun, 6 Nov 2011 10:47:45 +0000 (10:47 +0000)
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Sun, 6 Nov 2011 10:47:45 +0000 (10:47 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@7739 e93f8b46-1217-0410-a6f0-8f06a7374b81

test/functional/wiki_controller_test.rb

index 5ff365d210da98035a362fa964ee5e0e19564ba3..9247dfdb819887ae0d47ea391ac9472e1d79d112 100644 (file)
@@ -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