summaryrefslogtreecommitdiffstats
path: root/test/functional/repositories_mercurial_controller_test.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2011-12-03 15:06:23 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2011-12-03 15:06:23 +0000
commitf660d5f1837f4cd2f7232535fb18b313f1c4ed40 (patch)
tree4b38d7018ba9f8ccc7c096dfb44f6e190f69064b /test/functional/repositories_mercurial_controller_test.rb
parente2e3af4f0dc0c39e5b57325bb37d3d064a27b483 (diff)
downloadredmine-f660d5f1837f4cd2f7232535fb18b313f1c4ed40.tar.gz
redmine-f660d5f1837f4cd2f7232535fb18b313f1c4ed40.zip
Test for repository edit and cleanup.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8049 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/functional/repositories_mercurial_controller_test.rb')
-rw-r--r--test/functional/repositories_mercurial_controller_test.rb21
1 files changed, 14 insertions, 7 deletions
diff --git a/test/functional/repositories_mercurial_controller_test.rb b/test/functional/repositories_mercurial_controller_test.rb
index 71a29af6e..1a580a62d 100644
--- a/test/functional/repositories_mercurial_controller_test.rb
+++ b/test/functional/repositories_mercurial_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 RepositoriesMercurialControllerTest < ActionController::TestCase
+ tests RepositoriesController
+
fixtures :projects, :users, :roles, :members, :member_roles,
:repositories, :enabled_modules
@@ -34,9 +32,6 @@ class RepositoriesMercurialControllerTest < ActionController::TestCase
(RUBY_VERSION >= '1.9' && Encoding.default_external.to_s != 'UTF-8')
def setup
- @controller = RepositoriesController.new
- @request = ActionController::TestRequest.new
- @response = ActionController::TestResponse.new
User.current = nil
@project = Project.find(PRJ_ID)
@repository = Repository::Mercurial.create(
@@ -64,6 +59,18 @@ class RepositoriesMercurialControllerTest < ActionController::TestCase
"Current value is '#{Encoding.default_external.to_s}'"
def test_fake; assert true end
elsif File.directory?(REPOSITORY_PATH)
+
+ def test_get_edit
+ @request.session[:user_id] = 1
+ @project.repository.destroy
+ xhr :get, :edit, :id => 'subproject1', :repository_scm => 'Mercurial'
+ assert_response :success
+ assert_equal 'text/javascript', @response.content_type
+ assert_kind_of Repository::Mercurial, assigns(:repository)
+ assert assigns(:repository).new_record?
+ assert_select_rjs :replace_html, 'tab-content-repository'
+ end
+
def test_show_root
assert_equal 0, @repository.changesets.count
@repository.fetch_changesets