@@ -221,6 +221,34 class RepositoriesCvsControllerTest < ActionController::TestCase | |||||
221 | @project.reload |
|
221 | @project.reload | |
222 | assert_nil @project.repository |
|
222 | assert_nil @project.repository | |
223 | end |
|
223 | end | |
|
224 | ||||
|
225 | def test_destroy_invalid_repository | |||
|
226 | @request.session[:user_id] = 1 # admin | |||
|
227 | @repository.fetch_changesets | |||
|
228 | @repository.reload | |||
|
229 | assert @repository.changesets.count > 0 | |||
|
230 | ||||
|
231 | get :destroy, :id => PRJ_ID | |||
|
232 | assert_response 302 | |||
|
233 | @project.reload | |||
|
234 | assert_nil @project.repository | |||
|
235 | ||||
|
236 | @repository = Repository::Cvs.create( | |||
|
237 | :project => Project.find(PRJ_ID), | |||
|
238 | :root_url => "/invalid", | |||
|
239 | :url => MODULE_NAME, | |||
|
240 | :log_encoding => 'UTF-8' | |||
|
241 | ) | |||
|
242 | assert @repository | |||
|
243 | @repository.fetch_changesets | |||
|
244 | @repository.reload | |||
|
245 | assert_equal 0, @repository.changesets.count | |||
|
246 | ||||
|
247 | get :destroy, :id => PRJ_ID | |||
|
248 | assert_response 302 | |||
|
249 | @project.reload | |||
|
250 | assert_nil @project.repository | |||
|
251 | end | |||
224 | else |
|
252 | else | |
225 | puts "CVS test repository NOT FOUND. Skipping functional tests !!!" |
|
253 | puts "CVS test repository NOT FOUND. Skipping functional tests !!!" | |
226 | def test_fake; assert true end |
|
254 | def test_fake; assert true end |
General Comments 0
You need to be logged in to leave comments.
Login now