diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/fixtures/changesets.yml | 42 | ||||
-rw-r--r-- | test/functional/repositories_subversion_controller_test.rb | 5 | ||||
-rw-r--r-- | test/functional/search_controller_test.rb | 4 | ||||
-rw-r--r-- | test/unit/changeset_test.rb | 2 | ||||
-rw-r--r-- | test/unit/repository_subversion_test.rb | 12 |
5 files changed, 59 insertions, 6 deletions
diff --git a/test/fixtures/changesets.yml b/test/fixtures/changesets.yml index cbc00eb83..6c13d37e5 100644 --- a/test/fixtures/changesets.yml +++ b/test/fixtures/changesets.yml @@ -39,4 +39,46 @@ changesets_004: repository_id: 10
committer: dlopper
user_id: 3
+changesets_005:
+ commit_date: "2007-09-10"
+ comments: Modified one file in the folder.
+ committed_on: 2007-09-10 19:01:08
+ revision: "5"
+ id: 104
+ scmid:
+ user_id: 3
+ repository_id: 10
+ committer: dlopper
+changesets_006:
+ commit_date: "2007-09-10"
+ comments: Moved helloworld.rb from / to /folder.
+ committed_on: 2007-09-10 19:01:47
+ revision: "6"
+ id: 105
+ scmid:
+ user_id: 3
+ repository_id: 10
+ committer: dlopper
+changesets_007:
+ commit_date: "2007-09-10"
+ comments: Removed one file.
+ committed_on: 2007-09-10 19:02:16
+ revision: "7"
+ id: 106
+ scmid:
+ user_id: 3
+ repository_id: 10
+ committer: dlopper
+changesets_008:
+ commit_date: "2007-09-10"
+ comments: |-
+ This commits references an issue.
+ Refs #2
+ committed_on: 2007-09-10 19:04:35
+ revision: "8"
+ id: 107
+ scmid:
+ user_id: 3
+ repository_id: 10
+ committer: dlopper
\ No newline at end of file diff --git a/test/functional/repositories_subversion_controller_test.rb b/test/functional/repositories_subversion_controller_test.rb index ac1438572..8e4affade 100644 --- a/test/functional/repositories_subversion_controller_test.rb +++ b/test/functional/repositories_subversion_controller_test.rb @@ -79,6 +79,11 @@ class RepositoriesSubversionControllerTest < Test::Unit::TestCase get :changes, :id => 1, :path => ['subversion_test', 'folder', 'helloworld.rb' ] assert_response :success assert_template 'changes' + + changesets = assigns(:changesets) + assert_not_nil changesets + assert_equal %w(6 3 2), changesets.collect(&:revision) + # svn properties displayed with svn >= 1.5 only if Redmine::Scm::Adapters::SubversionAdapter.client_version_above?([1, 5, 0]) assert_not_nil assigns(:properties) diff --git a/test/functional/search_controller_test.rb b/test/functional/search_controller_test.rb index 0f74c537e..4f79081ae 100644 --- a/test/functional/search_controller_test.rb +++ b/test/functional/search_controller_test.rb @@ -41,8 +41,8 @@ class SearchControllerTest < Test::Unit::TestCase :sibling => { :tag => 'dd', :content => /should be classified by categories/ } assert assigns(:results_by_type).is_a?(Hash) - assert_equal 4, assigns(:results_by_type)['changesets'] - assert_tag :a, :content => 'Changesets (4)' + assert_equal 5, assigns(:results_by_type)['changesets'] + assert_tag :a, :content => 'Changesets (5)' end def test_search_issues diff --git a/test/unit/changeset_test.rb b/test/unit/changeset_test.rb index 78e2339f9..e5dc6d73f 100644 --- a/test/unit/changeset_test.rb +++ b/test/unit/changeset_test.rb @@ -69,7 +69,7 @@ class ChangesetTest < Test::Unit::TestCase end def test_next_nil - changeset = Changeset.find_by_revision('4') + changeset = Changeset.find_by_revision('8') assert_nil changeset.next end end diff --git a/test/unit/repository_subversion_test.rb b/test/unit/repository_subversion_test.rb index 4054a0e41..b0eb88c01 100644 --- a/test/unit/repository_subversion_test.rb +++ b/test/unit/repository_subversion_test.rb @@ -49,11 +49,17 @@ class RepositorySubversionTest < Test::Unit::TestCase assert_equal 8, @repository.changesets.count end - def test_changesets_for_path_with_limit + def test_latest_changesets_with_limit @repository.fetch_changesets - changesets = @repository.changesets_for_path('', :limit => 2) + changesets = @repository.latest_changesets('', nil, 2) assert_equal 2, changesets.size - assert_equal @repository.changesets_for_path('').slice(0,2), changesets + assert_equal @repository.latest_changesets('', nil).slice(0,2), changesets + end + + def test_latest_changesets_with_path + @repository.fetch_changesets + changesets = @repository.latest_changesets('subversion_test/folder/helloworld.rb', nil) + assert_equal %w(6 3 2), changesets.collect(&:revision) end else puts "Subversion test repository NOT FOUND. Skipping unit tests !!!" |