|
|
|
@ -38,17 +38,22 @@ describe RepositoriesController, 'Git', type: :controller do |
|
|
|
|
fixtures :all |
|
|
|
|
|
|
|
|
|
# No '..' in the repository path |
|
|
|
|
REPOSITORY_PATH = Rails.root.to_s.gsub(%r{config\/\.\.}, '') + '/tmp/test/git_repository' |
|
|
|
|
REPOSITORY_PATH.gsub!(/\//, '\\') if Redmine::Platform.mswin? |
|
|
|
|
let(:git_repository_path) { |
|
|
|
|
path = Rails.root.to_s.gsub(%r{config\/\.\.}, '') + '/tmp/test/git_repository' |
|
|
|
|
path.gsub!(/\//, '\\') if Redmine::Platform.mswin? |
|
|
|
|
path |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
before do |
|
|
|
|
skip 'Git test repository NOT FOUND. Skipping functional tests !!!' unless File.directory?(git_repository_path) |
|
|
|
|
|
|
|
|
|
@controller = RepositoriesController.new |
|
|
|
|
@request = ActionController::TestRequest.new |
|
|
|
|
@response = ActionController::TestResponse.new |
|
|
|
|
User.current = nil |
|
|
|
|
@repository = Repository::Git.create( |
|
|
|
|
project: Project.find(3), |
|
|
|
|
url: REPOSITORY_PATH, |
|
|
|
|
url: git_repository_path, |
|
|
|
|
path_encoding: 'ISO-8859-1' |
|
|
|
|
) |
|
|
|
|
|
|
|
|
@ -61,7 +66,6 @@ describe RepositoriesController, 'Git', type: :controller do |
|
|
|
|
assert @repository |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
if File.directory?(REPOSITORY_PATH) |
|
|
|
|
it 'should browse root' do |
|
|
|
|
@repository.fetch_changesets |
|
|
|
|
@repository.reload |
|
|
|
@ -254,8 +258,4 @@ describe RepositoriesController, 'Git', type: :controller do |
|
|
|
|
assert_error_tag content: /was not found/ |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
else |
|
|
|
|
puts 'Git test repository NOT FOUND. Skipping functional tests !!!' |
|
|
|
|
it 'should fake' do; assert true end |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|