Mercurial > hg > soundsoftware-site
comparison test/functional/.svn/text-base/attachments_controller_test.rb.svn-base @ 119:8661b858af72
* Update to Redmine trunk rev 4705
author | Chris Cannam |
---|---|
date | Thu, 13 Jan 2011 14:12:06 +0000 |
parents | 94944d00e43c |
children | cd2282d2aa55 cbce1fd3b1b7 |
comparison
equal
deleted
inserted
replaced
39:150ceac17a8d | 119:8661b858af72 |
---|---|
1 # redMine - project management software | 1 # encoding: utf-8 |
2 # Copyright (C) 2006-2008 Jean-Philippe Lang | 2 # |
3 # Redmine - project management software | |
4 # Copyright (C) 2006-2011 Jean-Philippe Lang | |
3 # | 5 # |
4 # This program is free software; you can redistribute it and/or | 6 # This program is free software; you can redistribute it and/or |
5 # modify it under the terms of the GNU General Public License | 7 # modify it under the terms of the GNU General Public License |
6 # as published by the Free Software Foundation; either version 2 | 8 # as published by the Free Software Foundation; either version 2 |
7 # of the License, or (at your option) any later version. | 9 # of the License, or (at your option) any later version. |
13 # | 15 # |
14 # You should have received a copy of the GNU General Public License | 16 # You should have received a copy of the GNU General Public License |
15 # along with this program; if not, write to the Free Software | 17 # along with this program; if not, write to the Free Software |
16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | 18 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
17 | 19 |
18 require File.dirname(__FILE__) + '/../test_helper' | 20 require File.expand_path('../../test_helper', __FILE__) |
19 require 'attachments_controller' | 21 require 'attachments_controller' |
20 | 22 |
21 # Re-raise errors caught by the controller. | 23 # Re-raise errors caught by the controller. |
22 class AttachmentsController; def rescue_action(e) raise e end; end | 24 class AttachmentsController; def rescue_action(e) raise e end; end |
23 | 25 |
33 Attachment.storage_path = "#{RAILS_ROOT}/test/fixtures/files" | 35 Attachment.storage_path = "#{RAILS_ROOT}/test/fixtures/files" |
34 User.current = nil | 36 User.current = nil |
35 end | 37 end |
36 | 38 |
37 def test_show_diff | 39 def test_show_diff |
38 get :show, :id => 5 | 40 get :show, :id => 14 # 060719210727_changeset_utf8.diff |
39 assert_response :success | 41 assert_response :success |
40 assert_template 'diff' | 42 assert_template 'diff' |
41 assert_equal 'text/html', @response.content_type | 43 assert_equal 'text/html', @response.content_type |
44 | |
45 assert_tag 'th', | |
46 :attributes => {:class => /filename/}, | |
47 :content => /issues_controller.rb\t\(révision 1484\)/ | |
48 assert_tag 'td', | |
49 :attributes => {:class => /line-code/}, | |
50 :content => /Demande créée avec succès/ | |
51 end | |
52 | |
53 def test_show_diff_should_strip_non_utf8_content | |
54 get :show, :id => 5 # 060719210727_changeset_iso8859-1.diff | |
55 assert_response :success | |
56 assert_template 'diff' | |
57 assert_equal 'text/html', @response.content_type | |
58 | |
59 assert_tag 'th', | |
60 :attributes => {:class => /filename/}, | |
61 :content => /issues_controller.rb\t\(rvision 1484\)/ | |
62 assert_tag 'td', | |
63 :attributes => {:class => /line-code/}, | |
64 :content => /Demande cre avec succs/ | |
42 end | 65 end |
43 | 66 |
44 def test_show_text_file | 67 def test_show_text_file |
45 get :show, :id => 4 | 68 get :show, :id => 4 |
46 assert_response :success | 69 assert_response :success |