##// END OF EJS Templates
Rails3: test: scm: subversion: use "repository_path_hash" for path param...
Toshi MARUYAMA -
r8810:5033a155b3e5
parent child
Show More
@@ -73,7 +73,7 class RepositoriesSubversionControllerTest < ActionController::TestCase
73 @repository.fetch_changesets
73 @repository.fetch_changesets
74 @project.reload
74 @project.reload
75 assert_equal NUM_REV, @repository.changesets.count
75 assert_equal NUM_REV, @repository.changesets.count
76 get :show, :id => PRJ_ID, :path => ['subversion_test']
76 get :show, :id => PRJ_ID, :path => repository_path_hash(['subversion_test'])[:param]
77 assert_response :success
77 assert_response :success
78 assert_template 'show'
78 assert_template 'show'
79 assert_not_nil assigns(:entries)
79 assert_not_nil assigns(:entries)
@@ -93,7 +93,8 class RepositoriesSubversionControllerTest < ActionController::TestCase
93 @repository.fetch_changesets
93 @repository.fetch_changesets
94 @project.reload
94 @project.reload
95 assert_equal NUM_REV, @repository.changesets.count
95 assert_equal NUM_REV, @repository.changesets.count
96 get :show, :id => PRJ_ID, :path => ['subversion_test'], :rev => 4
96 get :show, :id => PRJ_ID, :path => repository_path_hash(['subversion_test'])[:param],
97 :rev => 4
97 assert_response :success
98 assert_response :success
98 assert_template 'show'
99 assert_template 'show'
99 assert_not_nil assigns(:entries)
100 assert_not_nil assigns(:entries)
@@ -106,7 +107,8 class RepositoriesSubversionControllerTest < ActionController::TestCase
106 @repository.fetch_changesets
107 @repository.fetch_changesets
107 @project.reload
108 @project.reload
108 assert_equal NUM_REV, @repository.changesets.count
109 assert_equal NUM_REV, @repository.changesets.count
109 get :changes, :id => PRJ_ID, :path => ['subversion_test', 'folder', 'helloworld.rb' ]
110 get :changes, :id => PRJ_ID,
111 :path => repository_path_hash(['subversion_test', 'folder', 'helloworld.rb'])[:param]
110 assert_response :success
112 assert_response :success
111 assert_template 'changes'
113 assert_template 'changes'
112
114
@@ -130,7 +132,8 class RepositoriesSubversionControllerTest < ActionController::TestCase
130 @repository.fetch_changesets
132 @repository.fetch_changesets
131 @project.reload
133 @project.reload
132 assert_equal NUM_REV, @repository.changesets.count
134 assert_equal NUM_REV, @repository.changesets.count
133 get :changes, :id => PRJ_ID, :path => ['subversion_test', 'folder' ]
135 get :changes, :id => PRJ_ID,
136 :path => repository_path_hash(['subversion_test', 'folder'])[:param]
134 assert_response :success
137 assert_response :success
135 assert_template 'changes'
138 assert_template 'changes'
136
139
@@ -144,7 +147,8 class RepositoriesSubversionControllerTest < ActionController::TestCase
144 @repository.fetch_changesets
147 @repository.fetch_changesets
145 @project.reload
148 @project.reload
146 assert_equal NUM_REV, @repository.changesets.count
149 assert_equal NUM_REV, @repository.changesets.count
147 get :entry, :id => PRJ_ID, :path => ['subversion_test', 'helloworld.c']
150 get :entry, :id => PRJ_ID,
151 :path => repository_path_hash(['subversion_test', 'helloworld.c'])[:param]
148 assert_response :success
152 assert_response :success
149 assert_template 'entry'
153 assert_template 'entry'
150 end
154 end
@@ -156,7 +160,8 class RepositoriesSubversionControllerTest < ActionController::TestCase
156 assert_equal NUM_REV, @repository.changesets.count
160 assert_equal NUM_REV, @repository.changesets.count
157 # no files in the test repo is larger than 1KB...
161 # no files in the test repo is larger than 1KB...
158 with_settings :file_max_size_displayed => 0 do
162 with_settings :file_max_size_displayed => 0 do
159 get :entry, :id => PRJ_ID, :path => ['subversion_test', 'helloworld.c']
163 get :entry, :id => PRJ_ID,
164 :path => repository_path_hash(['subversion_test', 'helloworld.c'])[:param]
160 assert_response :success
165 assert_response :success
161 assert_template ''
166 assert_template ''
162 assert_equal 'attachment; filename="helloworld.c"',
167 assert_equal 'attachment; filename="helloworld.c"',
@@ -169,7 +174,9 class RepositoriesSubversionControllerTest < ActionController::TestCase
169 @repository.fetch_changesets
174 @repository.fetch_changesets
170 @project.reload
175 @project.reload
171 assert_equal NUM_REV, @repository.changesets.count
176 assert_equal NUM_REV, @repository.changesets.count
172 get :entry, :id => PRJ_ID, :path => ['subversion_test', 'helloworld.rb'], :rev => 2
177 get :entry, :id => PRJ_ID,
178 :path => repository_path_hash(['subversion_test', 'helloworld.rb'])[:param],
179 :rev => 2
173 assert_response :success
180 assert_response :success
174 assert_template 'entry'
181 assert_template 'entry'
175 # this line was removed in r3 and file was moved in r6
182 # this line was removed in r3 and file was moved in r6
@@ -182,9 +189,10 class RepositoriesSubversionControllerTest < ActionController::TestCase
182 @repository.fetch_changesets
189 @repository.fetch_changesets
183 @project.reload
190 @project.reload
184 assert_equal NUM_REV, @repository.changesets.count
191 assert_equal NUM_REV, @repository.changesets.count
185 get :entry, :id => PRJ_ID, :path => ['subversion_test', 'zzz.c']
192 get :entry, :id => PRJ_ID,
193 :path => repository_path_hash(['subversion_test', 'zzz.c'])[:param]
186 assert_tag :tag => 'p', :attributes => { :id => /errorExplanation/ },
194 assert_tag :tag => 'p', :attributes => { :id => /errorExplanation/ },
187 :content => /The entry or revision was not found in the repository/
195 :content => /The entry or revision was not found in the repository/
188 end
196 end
189
197
190 def test_entry_download
198 def test_entry_download
@@ -192,7 +200,9 class RepositoriesSubversionControllerTest < ActionController::TestCase
192 @repository.fetch_changesets
200 @repository.fetch_changesets
193 @project.reload
201 @project.reload
194 assert_equal NUM_REV, @repository.changesets.count
202 assert_equal NUM_REV, @repository.changesets.count
195 get :entry, :id => PRJ_ID, :path => ['subversion_test', 'helloworld.c'], :format => 'raw'
203 get :entry, :id => PRJ_ID,
204 :path => repository_path_hash(['subversion_test', 'helloworld.c'])[:param],
205 :format => 'raw'
196 assert_response :success
206 assert_response :success
197 assert_template ''
207 assert_template ''
198 assert_equal 'attachment; filename="helloworld.c"', @response.headers['Content-Disposition']
208 assert_equal 'attachment; filename="helloworld.c"', @response.headers['Content-Disposition']
@@ -203,7 +213,8 class RepositoriesSubversionControllerTest < ActionController::TestCase
203 @repository.fetch_changesets
213 @repository.fetch_changesets
204 @project.reload
214 @project.reload
205 assert_equal NUM_REV, @repository.changesets.count
215 assert_equal NUM_REV, @repository.changesets.count
206 get :entry, :id => PRJ_ID, :path => ['subversion_test', 'folder']
216 get :entry, :id => PRJ_ID,
217 :path => repository_path_hash(['subversion_test', 'folder'])[:param]
207 assert_response :success
218 assert_response :success
208 assert_template 'show'
219 assert_template 'show'
209 assert_not_nil assigns(:entry)
220 assert_not_nil assigns(:entry)
@@ -313,7 +324,8 class RepositoriesSubversionControllerTest < ActionController::TestCase
313 assert_equal NUM_REV, @repository.changesets.count
324 assert_equal NUM_REV, @repository.changesets.count
314 ['inline', 'sbs'].each do |dt|
325 ['inline', 'sbs'].each do |dt|
315 get :diff, :id => PRJ_ID, :rev => 6, :rev_to => 2,
326 get :diff, :id => PRJ_ID, :rev => 6, :rev_to => 2,
316 :path => ['subversion_test', 'folder'], :type => dt
327 :path => repository_path_hash(['subversion_test', 'folder'])[:param],
328 :type => dt
317 assert_response :success
329 assert_response :success
318 assert_template 'diff'
330 assert_template 'diff'
319
331
@@ -330,7 +342,8 class RepositoriesSubversionControllerTest < ActionController::TestCase
330 @repository.fetch_changesets
342 @repository.fetch_changesets
331 @project.reload
343 @project.reload
332 assert_equal NUM_REV, @repository.changesets.count
344 assert_equal NUM_REV, @repository.changesets.count
333 get :annotate, :id => PRJ_ID, :path => ['subversion_test', 'helloworld.c']
345 get :annotate, :id => PRJ_ID,
346 :path => repository_path_hash(['subversion_test', 'helloworld.c'])[:param]
334 assert_response :success
347 assert_response :success
335 assert_template 'annotate'
348 assert_template 'annotate'
336 end
349 end
@@ -340,7 +353,8 class RepositoriesSubversionControllerTest < ActionController::TestCase
340 @repository.fetch_changesets
353 @repository.fetch_changesets
341 @project.reload
354 @project.reload
342 assert_equal NUM_REV, @repository.changesets.count
355 assert_equal NUM_REV, @repository.changesets.count
343 get :annotate, :id => PRJ_ID, :rev => 8, :path => ['subversion_test', 'helloworld.c']
356 get :annotate, :id => PRJ_ID, :rev => 8,
357 :path => repository_path_hash(['subversion_test', 'helloworld.c'])[:param]
344 assert_response :success
358 assert_response :success
345 assert_template 'annotate'
359 assert_template 'annotate'
346 assert_tag :tag => 'h2', :content => /@ 8/
360 assert_tag :tag => 'h2', :content => /@ 8/
General Comments 0
You need to be logged in to leave comments. Login now