##// END OF EJS Templates
Merged r4710 and r4714 from trunk....
Toshi MARUYAMA -
r4596:6188b9eddba7
parent child
Show More
@@ -225,7 +225,7 class RepositoriesController < ApplicationController
225 225 end
226 226
227 227 def show_error_not_found
228 render_error l(:error_scm_not_found)
228 render_error :message => l(:error_scm_not_found), :status => 404
229 229 end
230 230
231 231 # Handler for Redmine::Scm::Adapters::CommandFailed exception
@@ -192,7 +192,7 class RepositoriesGitControllerTest < ActionController::TestCase
192 192 @repository.reload
193 193 ['', ' ', nil].each do |r|
194 194 get :revision, :id => 1, :rev => r
195 assert_response 500
195 assert_response 404
196 196 assert_error_tag :content => /was not found/
197 197 end
198 198 end
@@ -32,9 +32,10 class RepositoriesMercurialControllerTest < ActionController::TestCase
32 32 @request = ActionController::TestRequest.new
33 33 @response = ActionController::TestResponse.new
34 34 User.current = nil
35 Repository::Mercurial.create(:project => Project.find(3), :url => REPOSITORY_PATH)
35 @repository = Repository::Mercurial.create(:project => Project.find(3), :url => REPOSITORY_PATH)
36 assert @repository
36 37 end
37
38
38 39 if File.directory?(REPOSITORY_PATH)
39 40 def test_show
40 41 get :show, :id => 3
@@ -164,6 +165,16 class RepositoriesMercurialControllerTest < ActionController::TestCase
164 165 :attributes => { :class => 'line-num' },
165 166 :sibling => { :tag => 'td', :content => /watcher =/ }
166 167 end
168
169 def test_empty_revision
170 @repository.fetch_changesets
171 @repository.reload
172 ['', ' ', nil].each do |r|
173 get :revision, :id => 3, :rev => r
174 assert_response 404
175 assert_error_tag :content => /was not found/
176 end
177 end
167 178 else
168 179 puts "Mercurial test repository NOT FOUND. Skipping functional tests !!!"
169 180 def test_fake; assert true end
@@ -168,14 +168,14 class RepositoriesSubversionControllerTest < ActionController::TestCase
168 168
169 169 def test_invalid_revision
170 170 get :revision, :id => 1, :rev => 'something_weird'
171 assert_response 500
171 assert_response 404
172 172 assert_error_tag :content => /was not found/
173 173 end
174 174
175 175 def test_empty_revision
176 176 ['', ' ', nil].each do |r|
177 177 get :revision, :id => 1, :rev => r
178 assert_response 500
178 assert_response 404
179 179 assert_error_tag :content => /was not found/
180 180 end
181 181 end
General Comments 0
You need to be logged in to leave comments. Login now