diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2013-05-12 10:05:35 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2013-05-12 10:05:35 +0000 |
commit | 0dce4761a868eafaf216bf83e41860bf841926d8 (patch) | |
tree | a536ada9eca0626769b7c3dd777ce6c0e136e21d /test/functional/repositories_controller_test.rb | |
parent | 9b7d312a0e663e7d1d797a277522c6b79a02b119 (diff) | |
download | redmine-0dce4761a868eafaf216bf83e41860bf841926d8.tar.gz redmine-0dce4761a868eafaf216bf83e41860bf841926d8.zip |
Disable autofetching of repository changesets if projects are closed (#13945).
Patch by Mischa The Evil.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11838 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/functional/repositories_controller_test.rb')
-rw-r--r-- | test/functional/repositories_controller_test.rb | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/test/functional/repositories_controller_test.rb b/test/functional/repositories_controller_test.rb index 315090c59..2231e3134 100644 --- a/test/functional/repositories_controller_test.rb +++ b/test/functional/repositories_controller_test.rb @@ -111,6 +111,31 @@ class RepositoriesControllerTest < ActionController::TestCase assert_nil Repository.find_by_id(11) end + def test_show_with_autofetch_changesets_enabled_should_fetch_changesets + Repository::Subversion.any_instance.expects(:fetch_changesets).once + + with_settings :autofetch_changesets => '1' do + get :show, :id => 1 + end + end + + def test_show_with_autofetch_changesets_disabled_should_not_fetch_changesets + Repository::Subversion.any_instance.expects(:fetch_changesets).never + + with_settings :autofetch_changesets => '0' do + get :show, :id => 1 + end + end + + def test_show_with_closed_project_should_not_fetch_changesets + Repository::Subversion.any_instance.expects(:fetch_changesets).never + Project.find(1).close + + with_settings :autofetch_changesets => '1' do + get :show, :id => 1 + end + end + def test_revisions get :revisions, :id => 1 assert_response :success |