Test for repository edit and cleanup.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8050 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
f660d5f183
commit
4eb14ab85c
|
@ -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 RepositoriesGitControllerTest < ActionController::TestCase
|
||||
tests RepositoriesController
|
||||
|
||||
fixtures :projects, :users, :roles, :members, :member_roles,
|
||||
:repositories, :enabled_modules
|
||||
|
||||
|
@ -43,9 +41,6 @@ class RepositoriesGitControllerTest < ActionController::TestCase
|
|||
@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
|
||||
@project = Project.find(PRJ_ID)
|
||||
@repository = Repository::Git.create(
|
||||
|
@ -63,6 +58,17 @@ class RepositoriesGitControllerTest < 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 => 'Git'
|
||||
assert_response :success
|
||||
assert_equal 'text/javascript', @response.content_type
|
||||
assert_kind_of Repository::Git, 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
|
||||
|
|
Loading…
Reference in New Issue