@@ -66,27 +66,31 class RepositoriesMercurialControllerTest < ActionController::TestCase | |||||
66 | assert_equal 'file', entry.kind |
|
66 | assert_equal 'file', entry.kind | |
67 | assert_equal 'images/edit.png', entry.path |
|
67 | assert_equal 'images/edit.png', entry.path | |
68 | end |
|
68 | end | |
69 |
|
69 | |||
70 | def test_show_at_given_revision |
|
70 | def test_show_at_given_revision | |
71 | get :show, :id => 3, :path => ['images'], :rev => 0 |
|
71 | [0, '0', '0885933ad4f6'].each do |r1| | |
72 | assert_response :success |
|
72 | get :show, :id => 3, :path => ['images'], :rev => r1 | |
73 |
assert_ |
|
73 | assert_response :success | |
74 | assert_not_nil assigns(:entries) |
|
74 | assert_template 'show' | |
75 | assert_equal ['delete.png'], assigns(:entries).collect(&:name) |
|
75 | assert_not_nil assigns(:entries) | |
|
76 | assert_equal ['delete.png'], assigns(:entries).collect(&:name) | |||
|
77 | end | |||
76 | end |
|
78 | end | |
77 |
|
79 | |||
78 | def test_show_directory_sql_escape_percent |
|
80 | def test_show_directory_sql_escape_percent | |
79 | get :show, :id => 3, :path => ['sql_escape', 'percent%dir'], :rev => 13 |
|
81 | [13, '13', '3a330eb32958'].each do |r1| | |
80 | assert_response :success |
|
82 | get :show, :id => 3, :path => ['sql_escape', 'percent%dir'], :rev => r1 | |
81 |
assert_ |
|
83 | assert_response :success | |
|
84 | assert_template 'show' | |||
82 |
|
85 | |||
83 | assert_not_nil assigns(:entries) |
|
86 | assert_not_nil assigns(:entries) | |
84 | assert_equal ['percent%file1.txt', 'percentfile1.txt'], assigns(:entries).collect(&:name) |
|
87 | assert_equal ['percent%file1.txt', 'percentfile1.txt'], assigns(:entries).collect(&:name) | |
85 | changesets = assigns(:changesets) |
|
88 | changesets = assigns(:changesets) | |
86 |
|
89 | |||
87 | ## This is not yet implemented. |
|
90 | ## This is not yet implemented. | |
88 | # assert_not_nil changesets |
|
91 | # assert_not_nil changesets | |
89 | # assert_equal %w(13 11 10 9), changesets.collect(&:revision) |
|
92 | # assert_equal %w(13 11 10 9), changesets.collect(&:revision) | |
|
93 | end | |||
90 | end |
|
94 | end | |
91 |
|
95 | |||
92 | def test_changes |
|
96 | def test_changes | |
@@ -123,16 +127,18 class RepositoriesMercurialControllerTest < ActionController::TestCase | |||||
123 | end |
|
127 | end | |
124 |
|
128 | |||
125 | def test_diff |
|
129 | def test_diff | |
126 | # Full diff of changeset 4 |
|
130 | [4, '4', 'def6d2f1254a'].each do |r1| | |
127 | get :diff, :id => 3, :rev => 4 |
|
131 | # Full diff of changeset 4 | |
128 | assert_response :success |
|
132 | get :diff, :id => 3, :rev => 4 | |
129 | assert_template 'diff' |
|
133 | assert_response :success | |
130 | # Line 22 removed |
|
134 | assert_template 'diff' | |
131 | assert_tag :tag => 'th', |
|
135 | # Line 22 removed | |
132 | :content => '22', |
|
136 | assert_tag :tag => 'th', | |
133 |
|
|
137 | :content => '22', | |
134 |
|
|
138 | :sibling => { :tag => 'td', | |
135 |
|
|
139 | :attributes => { :class => /diff_out/ }, | |
|
140 | :content => /def remove/ } | |||
|
141 | end | |||
136 | end |
|
142 | end | |
137 |
|
143 | |||
138 | def test_annotate |
|
144 | def test_annotate |
General Comments 0
You need to be logged in to leave comments.
Login now