diff 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
line wrap: on
line diff
--- a/test/functional/.svn/text-base/attachments_controller_test.rb.svn-base	Thu Jan 13 13:21:03 2011 +0000
+++ b/test/functional/.svn/text-base/attachments_controller_test.rb.svn-base	Thu Jan 13 14:33:08 2011 +0000
@@ -1,5 +1,7 @@
-# redMine - project management software
-# Copyright (C) 2006-2008  Jean-Philippe Lang
+# encoding: utf-8
+#
+# Redmine - project management software
+# Copyright (C) 2006-2011  Jean-Philippe Lang
 #
 # This program is free software; you can redistribute it and/or
 # modify it under the terms of the GNU General Public License
@@ -35,10 +37,31 @@
   end
   
   def test_show_diff
-    get :show, :id => 5
+    get :show, :id => 14 # 060719210727_changeset_utf8.diff
     assert_response :success
     assert_template 'diff'
     assert_equal 'text/html', @response.content_type
+    
+    assert_tag 'th',
+      :attributes => {:class => /filename/},
+      :content => /issues_controller.rb\t\(révision 1484\)/
+    assert_tag 'td',
+      :attributes => {:class => /line-code/},
+      :content => /Demande créée avec succès/
+  end
+  
+  def test_show_diff_should_strip_non_utf8_content
+    get :show, :id => 5 # 060719210727_changeset_iso8859-1.diff
+    assert_response :success
+    assert_template 'diff'
+    assert_equal 'text/html', @response.content_type
+    
+    assert_tag 'th',
+      :attributes => {:class => /filename/},
+      :content => /issues_controller.rb\t\(rvision 1484\)/
+    assert_tag 'td',
+      :attributes => {:class => /line-code/},
+      :content => /Demande cre avec succs/
   end
   
   def test_show_text_file