comparison test/functional/.svn/text-base/attachments_controller_test.rb.svn-base @ 120:cd2282d2aa55 cannam

Merge from the default branch. Note that this is not a valid SVN repository any more (use default, redmine-1.1 etc for SVN updates).
author Chris Cannam
date Thu, 13 Jan 2011 14:33:08 +0000
parents af80e5618e9b 8661b858af72
children 753f1380d6bc
comparison
equal deleted inserted replaced
118:b859cc0c4fa1 120:cd2282d2aa55
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.
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