summaryrefslogtreecommitdiffstats
path: root/test/functional/repositories_darcs_controller_test.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2011-12-03 15:13:47 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2011-12-03 15:13:47 +0000
commite67afc88866ad6c85b8453c232e914ae55a62c76 (patch)
tree05a09844c7d62945df175ae086efb3b719da7b67 /test/functional/repositories_darcs_controller_test.rb
parenta08fa696d493962fb6fa68df0e6d89ea6580953e (diff)
downloadredmine-e67afc88866ad6c85b8453c232e914ae55a62c76.tar.gz
redmine-e67afc88866ad6c85b8453c232e914ae55a62c76.zip
Test for repository edit and cleanup.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8052 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/functional/repositories_darcs_controller_test.rb')
-rw-r--r--test/functional/repositories_darcs_controller_test.rb20
1 files changed, 13 insertions, 7 deletions
diff --git a/test/functional/repositories_darcs_controller_test.rb b/test/functional/repositories_darcs_controller_test.rb
index 4bc399b19..07d845a21 100644
--- a/test/functional/repositories_darcs_controller_test.rb
+++ b/test/functional/repositories_darcs_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 RepositoriesDarcsControllerTest < ActionController::TestCase
+ tests RepositoriesController
+
fixtures :projects, :users, :roles, :members, :member_roles,
:repositories, :enabled_modules
@@ -30,9 +28,6 @@ class RepositoriesDarcsControllerTest < ActionController::TestCase
NUM_REV = 6
def setup
- @controller = RepositoriesController.new
- @request = ActionController::TestRequest.new
- @response = ActionController::TestResponse.new
User.current = nil
@project = Project.find(PRJ_ID)
@repository = Repository::Darcs.create(
@@ -44,6 +39,17 @@ class RepositoriesDarcsControllerTest < 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 => 'Darcs'
+ assert_response :success
+ assert_equal 'text/javascript', @response.content_type
+ assert_kind_of Repository::Darcs, assigns(:repository)
+ assert assigns(:repository).new_record?
+ assert_select_rjs :replace_html, 'tab-content-repository'
+ end
+
def test_browse_root
assert_equal 0, @repository.changesets.count
@repository.fetch_changesets