@@ -37,11 +37,12 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 | # 060719210727_changeset_utf8.diff | |||
|
42 | get :show, :id => 14, :type => dt | |||
41 | assert_response :success |
|
43 | assert_response :success | |
42 | assert_template 'diff' |
|
44 | assert_template 'diff' | |
43 | assert_equal 'text/html', @response.content_type |
|
45 | assert_equal 'text/html', @response.content_type | |
44 |
|
||||
45 | assert_tag 'th', |
|
46 | assert_tag 'th', | |
46 | :attributes => {:class => /filename/}, |
|
47 | :attributes => {:class => /filename/}, | |
47 | :content => /issues_controller.rb\t\(révision 1484\)/ |
|
48 | :content => /issues_controller.rb\t\(révision 1484\)/ | |
@@ -49,13 +50,15 class AttachmentsControllerTest < ActionController::TestCase | |||||
49 | :attributes => {:class => /line-code/}, |
|
50 | :attributes => {:class => /line-code/}, | |
50 | :content => /Demande créée avec succès/ |
|
51 | :content => /Demande créée avec succès/ | |
51 | end |
|
52 | 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| | |
|
57 | # 060719210727_changeset_iso8859-1.diff | |||
|
58 | get :show, :id => 5, :type => dt | |||
55 | assert_response :success |
|
59 | assert_response :success | |
56 | assert_template 'diff' |
|
60 | assert_template 'diff' | |
57 | assert_equal 'text/html', @response.content_type |
|
61 | assert_equal 'text/html', @response.content_type | |
58 |
|
||||
59 | assert_tag 'th', |
|
62 | assert_tag 'th', | |
60 | :attributes => {:class => /filename/}, |
|
63 | :attributes => {:class => /filename/}, | |
61 | :content => /issues_controller.rb\t\(rvision 1484\)/ |
|
64 | :content => /issues_controller.rb\t\(rvision 1484\)/ | |
@@ -63,6 +66,7 class AttachmentsControllerTest < ActionController::TestCase | |||||
63 | :attributes => {:class => /line-code/}, |
|
66 | :attributes => {:class => /line-code/}, | |
64 | :content => /Demande cre avec succs/ |
|
67 | :content => /Demande cre avec succs/ | |
65 | end |
|
68 | end | |
|
69 | end | |||
66 |
|
70 | |||
67 | def test_show_text_file |
|
71 | def test_show_text_file | |
68 | get :show, :id => 4 |
|
72 | get :show, :id => 4 |
General Comments 0
You need to be logged in to leave comments.
Login now