scm: cvs: change project id of functional test from 1 to 3.

Project id 1 has Subversion fixtures.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@4789 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Toshi MARUYAMA 2011-02-02 04:00:59 +00:00
parent f922fa765f
commit 2b79e05e6c

View File

@ -29,6 +29,7 @@ class RepositoriesCvsControllerTest < ActionController::TestCase
REPOSITORY_PATH.gsub!(/\//, "\\") if Redmine::Platform.mswin? REPOSITORY_PATH.gsub!(/\//, "\\") if Redmine::Platform.mswin?
# CVS module # CVS module
MODULE_NAME = 'test' MODULE_NAME = 'test'
PRJ_ID = 3
def setup def setup
@controller = RepositoriesController.new @controller = RepositoriesController.new
@ -37,14 +38,18 @@ class RepositoriesCvsControllerTest < ActionController::TestCase
Setting.default_language = 'en' Setting.default_language = 'en'
User.current = nil User.current = nil
@project = Project.find(1) @project = Project.find(PRJ_ID)
@project.repository = Repository::Cvs.create(:root_url => REPOSITORY_PATH, @repository = Repository::Cvs.create(:project => Project.find(PRJ_ID),
:root_url => REPOSITORY_PATH,
:url => MODULE_NAME) :url => MODULE_NAME)
assert @repository
end end
if File.directory?(REPOSITORY_PATH) if File.directory?(REPOSITORY_PATH)
def test_show def test_show
get :show, :id => 1 @repository.fetch_changesets
@repository.reload
get :show, :id => PRJ_ID
assert_response :success assert_response :success
assert_template 'show' assert_template 'show'
assert_not_nil assigns(:entries) assert_not_nil assigns(:entries)
@ -52,7 +57,9 @@ class RepositoriesCvsControllerTest < ActionController::TestCase
end end
def test_browse_root def test_browse_root
get :show, :id => 1 @repository.fetch_changesets
@repository.reload
get :show, :id => PRJ_ID
assert_response :success assert_response :success
assert_template 'show' assert_template 'show'
assert_not_nil assigns(:entries) assert_not_nil assigns(:entries)
@ -66,7 +73,9 @@ class RepositoriesCvsControllerTest < ActionController::TestCase
end end
def test_browse_directory def test_browse_directory
get :show, :id => 1, :path => ['images'] @repository.fetch_changesets
@repository.reload
get :show, :id => PRJ_ID, :path => ['images']
assert_response :success assert_response :success
assert_template 'show' assert_template 'show'
assert_not_nil assigns(:entries) assert_not_nil assigns(:entries)
@ -78,8 +87,9 @@ class RepositoriesCvsControllerTest < ActionController::TestCase
end end
def test_browse_at_given_revision def test_browse_at_given_revision
Project.find(1).repository.fetch_changesets @repository.fetch_changesets
get :show, :id => 1, :path => ['images'], :rev => 1 @repository.reload
get :show, :id => PRJ_ID, :path => ['images'], :rev => 1
assert_response :success assert_response :success
assert_template 'show' assert_template 'show'
assert_not_nil assigns(:entries) assert_not_nil assigns(:entries)
@ -87,7 +97,9 @@ class RepositoriesCvsControllerTest < ActionController::TestCase
end end
def test_entry def test_entry
get :entry, :id => 1, :path => ['sources', 'watchers_controller.rb'] @repository.fetch_changesets
@repository.reload
get :entry, :id => PRJ_ID, :path => ['sources', 'watchers_controller.rb']
assert_response :success assert_response :success
assert_template 'entry' assert_template 'entry'
assert_no_tag :tag => 'td', :attributes => { :class => /line-code/}, assert_no_tag :tag => 'td', :attributes => { :class => /line-code/},
@ -96,8 +108,9 @@ class RepositoriesCvsControllerTest < ActionController::TestCase
def test_entry_at_given_revision def test_entry_at_given_revision
# changesets must be loaded # changesets must be loaded
Project.find(1).repository.fetch_changesets @repository.fetch_changesets
get :entry, :id => 1, :path => ['sources', 'watchers_controller.rb'], :rev => 2 @repository.reload
get :entry, :id => PRJ_ID, :path => ['sources', 'watchers_controller.rb'], :rev => 2
assert_response :success assert_response :success
assert_template 'entry' assert_template 'entry'
# this line was removed in r3 # this line was removed in r3
@ -106,18 +119,24 @@ class RepositoriesCvsControllerTest < ActionController::TestCase
end end
def test_entry_not_found def test_entry_not_found
get :entry, :id => 1, :path => ['sources', 'zzz.c'] @repository.fetch_changesets
@repository.reload
get :entry, :id => PRJ_ID, :path => ['sources', 'zzz.c']
assert_tag :tag => 'p', :attributes => { :id => /errorExplanation/ }, assert_tag :tag => 'p', :attributes => { :id => /errorExplanation/ },
:content => /The entry or revision was not found in the repository/ :content => /The entry or revision was not found in the repository/
end end
def test_entry_download def test_entry_download
get :entry, :id => 1, :path => ['sources', 'watchers_controller.rb'], :format => 'raw' @repository.fetch_changesets
@repository.reload
get :entry, :id => PRJ_ID, :path => ['sources', 'watchers_controller.rb'], :format => 'raw'
assert_response :success assert_response :success
end end
def test_directory_entry def test_directory_entry
get :entry, :id => 1, :path => ['sources'] @repository.fetch_changesets
@repository.reload
get :entry, :id => PRJ_ID, :path => ['sources']
assert_response :success assert_response :success
assert_template 'show' assert_template 'show'
assert_not_nil assigns(:entry) assert_not_nil assigns(:entry)
@ -125,8 +144,9 @@ class RepositoriesCvsControllerTest < ActionController::TestCase
end end
def test_diff def test_diff
Project.find(1).repository.fetch_changesets @repository.fetch_changesets
get :diff, :id => 1, :rev => 3, :type => 'inline' @repository.reload
get :diff, :id => PRJ_ID, :rev => 3, :type => 'inline'
assert_response :success assert_response :success
assert_template 'diff' assert_template 'diff'
assert_tag :tag => 'td', :attributes => { :class => 'line-code diff_out' }, assert_tag :tag => 'td', :attributes => { :class => 'line-code diff_out' },
@ -136,8 +156,9 @@ class RepositoriesCvsControllerTest < ActionController::TestCase
end end
def test_annotate def test_annotate
Project.find(1).repository.fetch_changesets @repository.fetch_changesets
get :annotate, :id => 1, :path => ['sources', 'watchers_controller.rb'] @repository.reload
get :annotate, :id => PRJ_ID, :path => ['sources', 'watchers_controller.rb']
assert_response :success assert_response :success
assert_template 'annotate' assert_template 'annotate'
# 1.1 line # 1.1 line