@@ -0,0 +1,33 | |||
|
1 | require File.expand_path('../../test_helper', __FILE__) | |
|
2 | ||
|
3 | class RepositoriesGitTest < ActionController::IntegrationTest | |
|
4 | fixtures :projects, :users, :roles, :members, :member_roles, | |
|
5 | :repositories, :enabled_modules | |
|
6 | ||
|
7 | REPOSITORY_PATH = Rails.root.join('tmp/test/git_repository').to_s | |
|
8 | REPOSITORY_PATH.gsub!(/\//, "\\") if Redmine::Platform.mswin? | |
|
9 | PRJ_ID = 3 | |
|
10 | ||
|
11 | def setup | |
|
12 | User.current = nil | |
|
13 | @project = Project.find(PRJ_ID) | |
|
14 | @repository = Repository::Git.create( | |
|
15 | :project => @project, | |
|
16 | :url => REPOSITORY_PATH, | |
|
17 | :path_encoding => 'ISO-8859-1' | |
|
18 | ) | |
|
19 | assert @repository | |
|
20 | end | |
|
21 | ||
|
22 | if File.directory?(REPOSITORY_PATH) | |
|
23 | def test_index | |
|
24 | get '/projects/subproject1/repository/' | |
|
25 | assert_response :success | |
|
26 | end | |
|
27 | ||
|
28 | def test_diff_two_revs | |
|
29 | get '/projects/subproject1/repository/diff?rev=61b685fbe&rev_to=2f9c0091' | |
|
30 | assert_response :success | |
|
31 | end | |
|
32 | end | |
|
33 | end |
@@ -249,11 +249,11 RedmineApp::Application.routes.draw do | |||
|
249 | 249 | get 'projects/:id/repository/:repository_id/:action(/*path(.:ext))', |
|
250 | 250 | :controller => 'repositories', |
|
251 | 251 | :action => /(browse|show|entry|raw|changes|annotate|diff)/ |
|
252 | get 'projects/:id/repository/:repository_id', :to => 'repositories#show', :path => nil | |
|
253 | ||
|
254 | 252 | get 'projects/:id/repository/:action(/*path(.:ext))', |
|
255 | 253 | :controller => 'repositories', |
|
256 | 254 | :action => /(browse|show|entry|raw|changes|annotate|diff)/ |
|
255 | ||
|
256 | get 'projects/:id/repository/:repository_id', :to => 'repositories#show', :path => nil | |
|
257 | 257 | get 'projects/:id/repository', :to => 'repositories#show', :path => nil |
|
258 | 258 | |
|
259 | 259 | # additional routes for having the file name at the end of url |
General Comments 0
You need to be logged in to leave comments.
Login now