選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

repositories_git_test.rb 1.7KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. # Redmine - project management software
  2. # Copyright (C) 2006-2016 Jean-Philippe Lang
  3. #
  4. # This program is free software; you can redistribute it and/or
  5. # modify it under the terms of the GNU General Public License
  6. # as published by the Free Software Foundation; either version 2
  7. # of the License, or (at your option) any later version.
  8. #
  9. # This program is distributed in the hope that it will be useful,
  10. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. # GNU General Public License for more details.
  13. #
  14. # You should have received a copy of the GNU General Public License
  15. # along with this program; if not, write to the Free Software
  16. # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  17. require File.expand_path('../../test_helper', __FILE__)
  18. class RepositoriesGitTest < Redmine::IntegrationTest
  19. fixtures :projects, :users, :roles, :members, :member_roles,
  20. :repositories, :enabled_modules
  21. REPOSITORY_PATH = Rails.root.join('tmp/test/git_repository').to_s
  22. REPOSITORY_PATH.gsub!(/\//, "\\") if Redmine::Platform.mswin?
  23. PRJ_ID = 3
  24. def setup
  25. User.current = nil
  26. @project = Project.find(PRJ_ID)
  27. @repository = Repository::Git.create(
  28. :project => @project,
  29. :url => REPOSITORY_PATH,
  30. :path_encoding => 'ISO-8859-1'
  31. )
  32. assert @repository
  33. end
  34. if File.directory?(REPOSITORY_PATH)
  35. def test_index
  36. get '/projects/subproject1/repository/'
  37. assert_response :success
  38. end
  39. def test_diff_two_revs
  40. get '/projects/subproject1/repository/diff?rev=61b685fbe&rev_to=2f9c0091'
  41. assert_response :success
  42. end
  43. end
  44. end