##// END OF EJS Templates
attachment: update functional tests to switch "side by side" and "inline" for patches (#9612)...
Toshi MARUYAMA -
r7741:00f9581380ea
parent child
Show More
@@ -37,31 +37,35 class AttachmentsControllerTest < ActionController::TestCase
37 end
37 end
38
38
39 def test_show_diff
39 def test_show_diff
40 get :show, :id => 14 # 060719210727_changeset_utf8.diff
40 ['inline', 'sbs'].each do |dt|
41 assert_response :success
41 # 060719210727_changeset_utf8.diff
42 assert_template 'diff'
42 get :show, :id => 14, :type => dt
43 assert_equal 'text/html', @response.content_type
43 assert_response :success
44
44 assert_template 'diff'
45 assert_tag 'th',
45 assert_equal 'text/html', @response.content_type
46 :attributes => {:class => /filename/},
46 assert_tag 'th',
47 :content => /issues_controller.rb\t\(révision 1484\)/
47 :attributes => {:class => /filename/},
48 assert_tag 'td',
48 :content => /issues_controller.rb\t\(révision 1484\)/
49 :attributes => {:class => /line-code/},
49 assert_tag 'td',
50 :content => /Demande créée avec succès/
50 :attributes => {:class => /line-code/},
51 :content => /Demande créée avec succès/
52 end
51 end
53 end
52
54
53 def test_show_diff_should_strip_non_utf8_content
55 def test_show_diff_should_strip_non_utf8_content
54 get :show, :id => 5 # 060719210727_changeset_iso8859-1.diff
56 ['inline', 'sbs'].each do |dt|
55 assert_response :success
57 # 060719210727_changeset_iso8859-1.diff
56 assert_template 'diff'
58 get :show, :id => 5, :type => dt
57 assert_equal 'text/html', @response.content_type
59 assert_response :success
58
60 assert_template 'diff'
59 assert_tag 'th',
61 assert_equal 'text/html', @response.content_type
60 :attributes => {:class => /filename/},
62 assert_tag 'th',
61 :content => /issues_controller.rb\t\(rvision 1484\)/
63 :attributes => {:class => /filename/},
62 assert_tag 'td',
64 :content => /issues_controller.rb\t\(rvision 1484\)/
63 :attributes => {:class => /line-code/},
65 assert_tag 'td',
64 :content => /Demande cre avec succs/
66 :attributes => {:class => /line-code/},
67 :content => /Demande cre avec succs/
68 end
65 end
69 end
66
70
67 def test_show_text_file
71 def test_show_text_file
General Comments 0
You need to be logged in to leave comments. Login now