Mercurial > hg > soundsoftware-site
diff test/unit/.svn/text-base/repository_subversion_test.rb.svn-base @ 117:af80e5618e9b redmine-1.1
* Update to Redmine 1.1-stable branch (Redmine SVN rev 4707)
author | Chris Cannam |
---|---|
date | Thu, 13 Jan 2011 12:53:21 +0000 |
parents | 513646585e45 |
children | 051f544170fe |
line wrap: on
line diff
--- a/test/unit/.svn/text-base/repository_subversion_test.rb.svn-base Fri Nov 19 14:05:24 2010 +0000 +++ b/test/unit/.svn/text-base/repository_subversion_test.rb.svn-base Thu Jan 13 12:53:21 2011 +0000 @@ -15,10 +15,10 @@ # 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' +require File.expand_path('../../test_helper', __FILE__) class RepositorySubversionTest < ActiveSupport::TestCase - fixtures :projects, :repositories + fixtures :projects, :repositories, :enabled_modules, :users, :roles def setup @project = Project.find(1) @@ -88,6 +88,54 @@ assert_equal 1, entries.size, 'Expect a single entry' assert_equal 'README.txt', entries.first.name end + + def test_identifier + @repository.fetch_changesets + @repository.reload + c = @repository.changesets.find_by_revision('1') + assert_equal c.revision, c.identifier + end + + def test_find_changeset_by_empty_name + @repository.fetch_changesets + @repository.reload + ['', ' ', nil].each do |r| + assert_nil @repository.find_changeset_by_name(r) + end + end + + def test_identifier_nine_digit + c = Changeset.new(:repository => @repository, :committed_on => Time.now, + :revision => '123456789', :comments => 'test') + assert_equal c.identifier, c.revision + end + + def test_format_identifier + @repository.fetch_changesets + @repository.reload + c = @repository.changesets.find_by_revision('1') + assert_equal c.format_identifier, c.revision + end + + def test_format_identifier_nine_digit + c = Changeset.new(:repository => @repository, :committed_on => Time.now, + :revision => '123456789', :comments => 'test') + assert_equal c.format_identifier, c.revision + end + + def test_activities + c = Changeset.new(:repository => @repository, :committed_on => Time.now, + :revision => '1', :comments => 'test') + assert c.event_title.include?('1:') + assert_equal '1', c.event_url[:rev] + end + + def test_activities_nine_digit + c = Changeset.new(:repository => @repository, :committed_on => Time.now, + :revision => '123456789', :comments => 'test') + assert c.event_title.include?('123456789:') + assert_equal '123456789', c.event_url[:rev] + end else puts "Subversion test repository NOT FOUND. Skipping unit tests !!!" def test_fake; assert true end