]> source.dussan.org Git - redmine.git/commitdiff
scm: bazaar: add changesets order test in unit model test.
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Wed, 16 Mar 2011 05:50:06 +0000 (05:50 +0000)
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Wed, 16 Mar 2011 05:50:06 +0000 (05:50 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@5148 e93f8b46-1217-0410-a6f0-8f06a7374b81

test/unit/repository_bazaar_test.rb

index b2515fe3084f0fbfcdaef40419967a98659180a3..038db8f23526dff599650287621d9d0b9dd14280 100644 (file)
@@ -71,6 +71,34 @@ class RepositoryBazaarTest < ActiveSupport::TestCase
       assert_equal 'file', entries.last.kind
       assert_equal 'edit.png', entries.last.name
     end
+
+    def test_previous
+      @repository.fetch_changesets
+      @repository.reload
+      changeset = @repository.find_changeset_by_name('3')
+      assert_equal @repository.find_changeset_by_name('2'), changeset.previous
+    end
+
+    def test_previous_nil
+      @repository.fetch_changesets
+      @repository.reload
+      changeset = @repository.find_changeset_by_name('1')
+      assert_nil changeset.previous
+    end
+
+    def test_next
+      @repository.fetch_changesets
+      @repository.reload
+      changeset = @repository.find_changeset_by_name('2')
+      assert_equal @repository.find_changeset_by_name('3'), changeset.next
+    end
+
+    def test_next_nil
+      @repository.fetch_changesets
+      @repository.reload
+      changeset = @repository.find_changeset_by_name('4')
+      assert_nil changeset.next
+    end
   else
     puts "Bazaar test repository NOT FOUND. Skipping unit tests !!!"
     def test_fake; assert true end