##// END OF EJS Templates
Do not mass create API keys for existing users....
Do not mass create API keys for existing users. They will be created on the fly if needed, just like for new users. git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@3221 e93f8b46-1217-0410-a6f0-8f06a7374b81

File last commit:

r3020:517a87f8c52e
r3107:edab0f0cbb85
Show More
repository_subversion_test.rb
72 lines | 2.7 KiB | text/x-ruby | RubyLexer
/ test / unit / repository_subversion_test.rb
Jean-Philippe Lang
Added Subversion repository unit tests....
r711 # redMine - project management software
# Copyright (C) 2006-2007 Jean-Philippe Lang
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
require File.dirname(__FILE__) + '/../test_helper'
Eric Davis
Upgraded to Rails 2.3.4 (#3597)...
r2773 class RepositorySubversionTest < ActiveSupport::TestCase
Jean-Philippe Lang
Added Subversion repository unit tests....
r711 fixtures :projects
# No '..' in the repository path for svn
REPOSITORY_PATH = RAILS_ROOT.gsub(%r{config\/\.\.}, '') + '/tmp/test/subversion_repository'
def setup
@project = Project.find(1)
assert @repository = Repository::Subversion.create(:project => @project, :url => "file:///#{REPOSITORY_PATH}")
end
if File.directory?(REPOSITORY_PATH)
def test_fetch_changesets_from_scratch
@repository.fetch_changesets
@repository.reload
Jean-Philippe Lang
Fixed: RepositoriesController#revision may show wrong revision (#3779)....
r2784 assert_equal 10, @repository.changesets.count
assert_equal 18, @repository.changes.count
Jean-Philippe Lang
Postgresql 8.3 compatibility fix (#834)....
r1348 assert_equal 'Initial import.', @repository.changesets.find_by_revision('1').comments
Jean-Philippe Lang
Added Subversion repository unit tests....
r711 end
def test_fetch_changesets_incremental
@repository.fetch_changesets
# Remove changesets with revision > 5
Jean-Philippe Lang
Postgresql 8.3 compatibility fix (#834)....
r1348 @repository.changesets.find(:all).each {|c| c.destroy if c.revision.to_i > 5}
Jean-Philippe Lang
Added Subversion repository unit tests....
r711 @repository.reload
assert_equal 5, @repository.changesets.count
@repository.fetch_changesets
Jean-Philippe Lang
Fixed: RepositoriesController#revision may show wrong revision (#3779)....
r2784 assert_equal 10, @repository.changesets.count
Jean-Philippe Lang
Added Subversion repository unit tests....
r711 end
Jean-Philippe Lang
Adds a setting to limit the number of revisions displayed on a repository file log (default=100)....
r2348
Jean-Philippe Lang
Fixed: Subversion#latest_changesets ignores revision argument (#4360)....
r3020 def test_latest_changesets
Jean-Philippe Lang
Adds a setting to limit the number of revisions displayed on a repository file log (default=100)....
r2348 @repository.fetch_changesets
Jean-Philippe Lang
Fixed: Subversion#latest_changesets ignores revision argument (#4360)....
r3020
# with limit
Jean-Philippe Lang
SCM:...
r2739 changesets = @repository.latest_changesets('', nil, 2)
Jean-Philippe Lang
Adds a setting to limit the number of revisions displayed on a repository file log (default=100)....
r2348 assert_equal 2, changesets.size
Jean-Philippe Lang
SCM:...
r2739 assert_equal @repository.latest_changesets('', nil).slice(0,2), changesets
Jean-Philippe Lang
Fixed: Subversion#latest_changesets ignores revision argument (#4360)....
r3020
# with path
changesets = @repository.latest_changesets('subversion_test/folder', nil)
assert_equal ["10", "9", "7", "6", "5", "2"], changesets.collect(&:revision)
# with path and revision
changesets = @repository.latest_changesets('subversion_test/folder', 8)
assert_equal ["7", "6", "5", "2"], changesets.collect(&:revision)
Jean-Philippe Lang
Adds a setting to limit the number of revisions displayed on a repository file log (default=100)....
r2348 end
Jean-Philippe Lang
Added Subversion repository unit tests....
r711 else
Jean-Philippe Lang
Added some functional tests (projects and repositories)....
r968 puts "Subversion test repository NOT FOUND. Skipping unit tests !!!"
Jean-Philippe Lang
Added some unit tests for the Bazaar adapter....
r938 def test_fake; assert true end
Jean-Philippe Lang
Added Subversion repository unit tests....
r711 end
end