summaryrefslogtreecommitdiffstats
path: root/test/functional/repositories_filesystem_controller_test.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2011-12-03 15:10:41 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2011-12-03 15:10:41 +0000
commita08fa696d493962fb6fa68df0e6d89ea6580953e (patch)
treed59de00ac22faea1dc4b828fdd8850cf851347e0 /test/functional/repositories_filesystem_controller_test.rb
parent4eb14ab85cf4c60a1a406578e9547f31db60de95 (diff)
downloadredmine-a08fa696d493962fb6fa68df0e6d89ea6580953e.tar.gz
redmine-a08fa696d493962fb6fa68df0e6d89ea6580953e.zip
Test for repository edit and cleanup.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8051 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/functional/repositories_filesystem_controller_test.rb')
-rw-r--r--test/functional/repositories_filesystem_controller_test.rb20
1 files changed, 13 insertions, 7 deletions
diff --git a/test/functional/repositories_filesystem_controller_test.rb b/test/functional/repositories_filesystem_controller_test.rb
index d40948644..257537893 100644
--- a/test/functional/repositories_filesystem_controller_test.rb
+++ b/test/functional/repositories_filesystem_controller_test.rb
@@ -16,12 +16,10 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
require File.expand_path('../../test_helper', __FILE__)
-require 'repositories_controller'
-
-# Re-raise errors caught by the controller.
-class RepositoriesController; def rescue_action(e) raise e end; end
class RepositoriesFilesystemControllerTest < ActionController::TestCase
+ tests RepositoriesController
+
fixtures :projects, :users, :roles, :members, :member_roles,
:repositories, :enabled_modules
@@ -31,9 +29,6 @@ class RepositoriesFilesystemControllerTest < ActionController::TestCase
def setup
@ruby19_non_utf8_pass =
(RUBY_VERSION >= '1.9' && Encoding.default_external.to_s != 'UTF-8')
- @controller = RepositoriesController.new
- @request = ActionController::TestRequest.new
- @response = ActionController::TestResponse.new
User.current = nil
Setting.enabled_scm << 'Filesystem' unless Setting.enabled_scm.include?('Filesystem')
@project = Project.find(PRJ_ID)
@@ -46,6 +41,17 @@ class RepositoriesFilesystemControllerTest < ActionController::TestCase
end
if File.directory?(REPOSITORY_PATH)
+ def test_get_edit
+ @request.session[:user_id] = 1
+ @project.repository.destroy
+ xhr :get, :edit, :id => 'subproject1', :repository_scm => 'Filesystem'
+ assert_response :success
+ assert_equal 'text/javascript', @response.content_type
+ assert_kind_of Repository::Filesystem, assigns(:repository)
+ assert assigns(:repository).new_record?
+ assert_select_rjs :replace_html, 'tab-content-repository'
+ end
+
def test_browse_root
@repository.fetch_changesets
@repository.reload