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