]> source.dussan.org Git - redmine.git/commitdiff
scm: mercurial: add test of binary file should be force download in functional test...
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Tue, 22 Mar 2011 11:26:57 +0000 (11:26 +0000)
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Tue, 22 Mar 2011 11:26:57 +0000 (11:26 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@5202 e93f8b46-1217-0410-a6f0-8f06a7374b81

test/functional/repositories_mercurial_controller_test.rb

index 830915a7957f7ddfd6e0be00568ed29337be9bae..8247bcb007c65d7e991bc0c0650e48f72dfa9ff4 100644 (file)
@@ -219,6 +219,13 @@ class RepositoriesMercurialControllerTest < ActionController::TestCase
       assert @response.body.include?('WITHOUT ANY WARRANTY')
     end
 
+    def test_entry_binary_force_download
+      get :entry, :id => PRJ_ID, :rev => 1, :path => ['images', 'edit.png']
+      assert_response :success
+      # TODO: 'image/png'
+      assert_equal 'application/octet-stream', @response.content_type
+    end
+
     def test_directory_entry
       get :entry, :id => PRJ_ID, :path => ['sources']
       assert_response :success
@@ -226,7 +233,7 @@ class RepositoriesMercurialControllerTest < ActionController::TestCase
       assert_not_nil assigns(:entry)
       assert_equal 'sources', assigns(:entry).name
     end
-    
+
     def test_diff
       @repository.fetch_changesets
       @repository.reload