diff options
author | Toshi MARUYAMA <marutosijp2@yahoo.co.jp> | 2012-02-17 14:27:52 +0000 |
---|---|---|
committer | Toshi MARUYAMA <marutosijp2@yahoo.co.jp> | 2012-02-17 14:27:52 +0000 |
commit | ff65babd1c38c5a737738503a4b9f49da6e48911 (patch) | |
tree | 36aed2865733cac84c636ffc4df68d845c12cce5 /test | |
parent | 5e08a0bc9d93f5136c8c3de530601055f8942dce (diff) | |
download | redmine-ff65babd1c38c5a737738503a4b9f49da6e48911.tar.gz redmine-ff65babd1c38c5a737738503a4b9f49da6e48911.zip |
scm: git: replace "order" at unit model test of fetching from scratch (#5357)
On Rails 3.0.11, this test fails.
Revision order of Git and Mercurial is not date/time order.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8898 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test')
-rw-r--r-- | test/unit/repository_git_test.rb | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/test/unit/repository_git_test.rb b/test/unit/repository_git_test.rb index febbd7025..6cfd3c65a 100644 --- a/test/unit/repository_git_test.rb +++ b/test/unit/repository_git_test.rb @@ -74,15 +74,14 @@ class RepositoryGitTest < ActiveSupport::TestCase assert_equal NUM_REV, @repository.changesets.count assert_equal 39, @repository.changes.count - commit = @repository.changesets.find(:first, :order => 'committed_on ASC') + commit = @repository.changesets.find_by_revision("7234cb2750b63f47bff735edc50a1c0a433c2518") + assert_equal "7234cb2750b63f47bff735edc50a1c0a433c2518", commit.scmid assert_equal "Initial import.\nThe repository contains 3 files.", commit.comments assert_equal "jsmith <jsmith@foo.bar>", commit.committer assert_equal User.find_by_login('jsmith'), commit.user # TODO: add a commit with commit time <> author time to the test repository assert_equal "2007-12-14 09:22:52".to_time, commit.committed_on assert_equal "2007-12-14".to_date, commit.commit_date - assert_equal "7234cb2750b63f47bff735edc50a1c0a433c2518", commit.revision - assert_equal "7234cb2750b63f47bff735edc50a1c0a433c2518", commit.scmid assert_equal 3, commit.changes.count change = commit.changes.sort_by(&:path).first assert_equal "README", change.path |