summaryrefslogtreecommitdiffstats
path: root/test/functional/repositories_bazaar_controller_test.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2012-01-15 14:23:06 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2012-01-15 14:23:06 +0000
commitfb1a2fd7cd4ca7335d660265a32604f6e2006dd6 (patch)
tree444bf09c5a63e91cc314de7c7e9fd78f93d1ff09 /test/functional/repositories_bazaar_controller_test.rb
parent6f462d373f1b57657082f22f882942d41df47a39 (diff)
downloadredmine-fb1a2fd7cd4ca7335d660265a32604f6e2006dd6.tar.gz
redmine-fb1a2fd7cd4ca7335d660265a32604f6e2006dd6.zip
Resourcified repositories for CRUD operations to prepare for multiple SCM per project (#779).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8648 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/functional/repositories_bazaar_controller_test.rb')
-rw-r--r--test/functional/repositories_bazaar_controller_test.rb30
1 files changed, 11 insertions, 19 deletions
diff --git a/test/functional/repositories_bazaar_controller_test.rb b/test/functional/repositories_bazaar_controller_test.rb
index 0273ef8cd..099c05088 100644
--- a/test/functional/repositories_bazaar_controller_test.rb
+++ b/test/functional/repositories_bazaar_controller_test.rb
@@ -37,15 +37,14 @@ class RepositoriesBazaarControllerTest < ActionController::TestCase
end
if File.directory?(REPOSITORY_PATH)
- def test_get_edit
+ def test_get_new
@request.session[:user_id] = 1
@project.repository.destroy
- xhr :get, :edit, :id => 'subproject1', :repository_scm => 'Bazaar'
+ get :new, :project_id => 'subproject1', :repository_scm => 'Bazaar'
assert_response :success
- assert_equal 'text/javascript', @response.content_type
+ assert_template 'new'
assert_kind_of Repository::Bazaar, assigns(:repository)
assert assigns(:repository).new_record?
- assert_select_rjs :replace_html, 'tab-content-repository'
end
def test_browse_root
@@ -157,10 +156,11 @@ class RepositoriesBazaarControllerTest < ActionController::TestCase
@request.session[:user_id] = 1 # admin
assert_equal 0, @repository.changesets.count
@repository.fetch_changesets
- @project.reload
assert @repository.changesets.count > 0
- get :destroy, :id => PRJ_ID
+ assert_difference 'Repository.count', -1 do
+ delete :destroy, :id => @repository.id
+ end
assert_response 302
@project.reload
assert_nil @project.repository
@@ -168,26 +168,18 @@ class RepositoriesBazaarControllerTest < ActionController::TestCase
def test_destroy_invalid_repository
@request.session[:user_id] = 1 # admin
- assert_equal 0, @repository.changesets.count
- @repository.fetch_changesets
- @project.reload
- assert @repository.changesets.count > 0
-
- get :destroy, :id => PRJ_ID
- assert_response 302
- @project.reload
- assert_nil @project.repository
-
- @repository = Repository::Bazaar.create(
+ @project.repository.destroy
+ @repository = Repository::Bazaar.create!(
:project => @project,
:url => "/invalid",
:log_encoding => 'UTF-8')
- assert @repository
@repository.fetch_changesets
@repository.reload
assert_equal 0, @repository.changesets.count
- get :destroy, :id => PRJ_ID
+ assert_difference 'Repository.count', -1 do
+ delete :destroy, :id => @repository.id
+ end
assert_response 302
@project.reload
assert_nil @project.repository