summaryrefslogtreecommitdiffstats
path: root/test/functional/repositories_controller_test.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2012-01-15 18:19:19 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2012-01-15 18:19:19 +0000
commit1bd5e58c847816ae5751ee0026e55597d1541dd4 (patch)
treeb5c1be1f966f8b08986978713882856d014e363d /test/functional/repositories_controller_test.rb
parentd996cc0584901e7f44171093b170f882978124f7 (diff)
downloadredmine-1bd5e58c847816ae5751ee0026e55597d1541dd4.tar.gz
redmine-1bd5e58c847816ae5751ee0026e55597d1541dd4.zip
Adds support for multiple repositories per project (#779).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8650 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/functional/repositories_controller_test.rb')
-rw-r--r--test/functional/repositories_controller_test.rb25
1 files changed, 17 insertions, 8 deletions
diff --git a/test/functional/repositories_controller_test.rb b/test/functional/repositories_controller_test.rb
index 4310c7630..817e16e2a 100644
--- a/test/functional/repositories_controller_test.rb
+++ b/test/functional/repositories_controller_test.rb
@@ -43,19 +43,12 @@ class RepositoriesControllerTest < ActionController::TestCase
assert_tag 'input', :attributes => {:name => 'repository[url]'}
end
- # TODO: remove it when multiple SCM support is added
- def test_new_with_existing_repository
- @request.session[:user_id] = 1
- get :new, :project_id => 'ecookbook'
- assert_response 302
- end
-
def test_create
@request.session[:user_id] = 1
assert_difference 'Repository.count' do
post :create, :project_id => 'subproject1',
:repository_scm => 'Subversion',
- :repository => {:url => 'file:///test'}
+ :repository => {:url => 'file:///test', :is_default => '1', :identifier => ''}
end
assert_response 302
repository = Repository.first(:order => 'id DESC')
@@ -113,9 +106,25 @@ class RepositoriesControllerTest < ActionController::TestCase
get :revisions, :id => 1
assert_response :success
assert_template 'revisions'
+ assert_equal Repository.find(10), assigns(:repository)
+ assert_not_nil assigns(:changesets)
+ end
+
+ def test_revisions_for_other_repository
+ repository = Repository::Subversion.create!(:project_id => 1, :identifier => 'foo', :url => 'file:///foo')
+
+ get :revisions, :id => 1, :repository_id => 'foo'
+ assert_response :success
+ assert_template 'revisions'
+ assert_equal repository, assigns(:repository)
assert_not_nil assigns(:changesets)
end
+ def test_revisions_for_invalid_repository
+ get :revisions, :id => 1, :repository_id => 'foo'
+ assert_response 404
+ end
+
def test_revision
get :revision, :id => 1, :rev => 1
assert_response :success