summaryrefslogtreecommitdiffstats
path: root/test/functional
diff options
context:
space:
mode:
authorGo MAEDA <maeda@farend.jp>2021-03-11 08:05:29 +0000
committerGo MAEDA <maeda@farend.jp>2021-03-11 08:05:29 +0000
commit6b13b3cc4dcd42e0c602eeff22b85483493afa59 (patch)
tree16416b47965acab090a1b38aab4d661c5ab153f4 /test/functional
parent880632eb6f8df6add83d428f41078bfccde40d18 (diff)
downloadredmine-6b13b3cc4dcd42e0c602eeff22b85483493afa59.tar.gz
redmine-6b13b3cc4dcd42e0c602eeff22b85483493afa59.zip
Use MiniTest::Assertions#skip to skip tests in RepositoriesControllerTest when Subversion test repository is not configured (#8875).
git-svn-id: http://svn.redmine.org/redmine/trunk@20774 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/functional')
-rw-r--r--test/functional/repositories_controller_test.rb56
1 files changed, 29 insertions, 27 deletions
diff --git a/test/functional/repositories_controller_test.rb b/test/functional/repositories_controller_test.rb
index 4f2067026..f2e3fae4e 100644
--- a/test/functional/repositories_controller_test.rb
+++ b/test/functional/repositories_controller_test.rb
@@ -188,37 +188,39 @@ class RepositoriesControllerTest < Redmine::RepositoryControllerTest
end
end
- if repository_configured?('subversion')
- def test_show_should_show_diff_button_depending_on_browse_repository_permission
- @request.session[:user_id] = 2
- role = Role.find(1)
+ def test_show_should_show_diff_button_depending_on_browse_repository_permission
+ skip unless repository_configured?('subversion')
- role.add_permission! :browse_repository
- get(:show, :params => {:id => 1})
- assert_response :success
- assert_select 'input[value="View differences"]'
+ @request.session[:user_id] = 2
+ role = Role.find(1)
- role.remove_permission! :browse_repository
- get(:show, :params => {:id => 1})
+ role.add_permission! :browse_repository
+ get(:show, :params => {:id => 1})
+ assert_response :success
+ assert_select 'input[value="View differences"]'
+
+ role.remove_permission! :browse_repository
+ get(:show, :params => {:id => 1})
+ assert_response :success
+ assert_select 'input[value="View differences"]', :count => 0
+ end
+
+ def test_fetch_changesets
+ skip unless repository_configured?('subversion')
+
+ @request.session[:user_id] = 2
+ role = Role.find(1)
+
+ with_settings :autofetch_changesets => '0' do
+ role.add_permission! :manage_repository
+ Repository::Subversion.any_instance.expects(:fetch_changesets).once
+ post(:fetch_changesets, :params => {:id => 1, :repository_id => 10})
assert_response :success
- assert_select 'input[value="View differences"]', :count => 0
- end
- def test_fetch_changesets
- @request.session[:user_id] = 2
- role = Role.find(1)
-
- with_settings :autofetch_changesets => '0' do
- role.add_permission! :manage_repository
- Repository::Subversion.any_instance.expects(:fetch_changesets).once
- post(:fetch_changesets, :params => {:id => 1, :repository_id => 10})
- assert_response :success
-
- role.remove_permission! :manage_repository
- Repository::Subversion.any_instance.expects(:fetch_changesets).never
- post(:fetch_changesets, :params => {:id => 1, :repository_id => 10})
- assert_response :forbidden
- end
+ role.remove_permission! :manage_repository
+ Repository::Subversion.any_instance.expects(:fetch_changesets).never
+ post(:fetch_changesets, :params => {:id => 1, :repository_id => 10})
+ assert_response :forbidden
end
end