@@ -16,12 +16,10 | |||
|
16 | 16 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
|
17 | 17 | |
|
18 | 18 | require File.expand_path('../../test_helper', __FILE__) |
|
19 | require 'repositories_controller' | |
|
20 | ||
|
21 | # Re-raise errors caught by the controller. | |
|
22 | class RepositoriesController; def rescue_action(e) raise e end; end | |
|
23 | 19 | |
|
24 | 20 | class RepositoriesFilesystemControllerTest < ActionController::TestCase |
|
21 | tests RepositoriesController | |
|
22 | ||
|
25 | 23 | fixtures :projects, :users, :roles, :members, :member_roles, |
|
26 | 24 | :repositories, :enabled_modules |
|
27 | 25 | |
@@ -31,9 +29,6 class RepositoriesFilesystemControllerTest < ActionController::TestCase | |||
|
31 | 29 | def setup |
|
32 | 30 | @ruby19_non_utf8_pass = |
|
33 | 31 | (RUBY_VERSION >= '1.9' && Encoding.default_external.to_s != 'UTF-8') |
|
34 | @controller = RepositoriesController.new | |
|
35 | @request = ActionController::TestRequest.new | |
|
36 | @response = ActionController::TestResponse.new | |
|
37 | 32 | User.current = nil |
|
38 | 33 | Setting.enabled_scm << 'Filesystem' unless Setting.enabled_scm.include?('Filesystem') |
|
39 | 34 | @project = Project.find(PRJ_ID) |
@@ -46,6 +41,17 class RepositoriesFilesystemControllerTest < ActionController::TestCase | |||
|
46 | 41 | end |
|
47 | 42 | |
|
48 | 43 | if File.directory?(REPOSITORY_PATH) |
|
44 | def test_get_edit | |
|
45 | @request.session[:user_id] = 1 | |
|
46 | @project.repository.destroy | |
|
47 | xhr :get, :edit, :id => 'subproject1', :repository_scm => 'Filesystem' | |
|
48 | assert_response :success | |
|
49 | assert_equal 'text/javascript', @response.content_type | |
|
50 | assert_kind_of Repository::Filesystem, assigns(:repository) | |
|
51 | assert assigns(:repository).new_record? | |
|
52 | assert_select_rjs :replace_html, 'tab-content-repository' | |
|
53 | end | |
|
54 | ||
|
49 | 55 | def test_browse_root |
|
50 | 56 | @repository.fetch_changesets |
|
51 | 57 | @repository.reload |
General Comments 0
You need to be logged in to leave comments.
Login now