@@ -225,7 +225,7 class RepositoriesController < ApplicationController | |||||
225 | end |
|
225 | end | |
226 |
|
226 | |||
227 | def show_error_not_found |
|
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 | end |
|
229 | end | |
230 |
|
230 | |||
231 | # Handler for Redmine::Scm::Adapters::CommandFailed exception |
|
231 | # Handler for Redmine::Scm::Adapters::CommandFailed exception |
@@ -192,7 +192,7 class RepositoriesGitControllerTest < ActionController::TestCase | |||||
192 | @repository.reload |
|
192 | @repository.reload | |
193 | ['', ' ', nil].each do |r| |
|
193 | ['', ' ', nil].each do |r| | |
194 | get :revision, :id => 1, :rev => r |
|
194 | get :revision, :id => 1, :rev => r | |
195 |
assert_response |
|
195 | assert_response 404 | |
196 | assert_error_tag :content => /was not found/ |
|
196 | assert_error_tag :content => /was not found/ | |
197 | end |
|
197 | end | |
198 | end |
|
198 | end |
@@ -32,9 +32,10 class RepositoriesMercurialControllerTest < ActionController::TestCase | |||||
32 | @request = ActionController::TestRequest.new |
|
32 | @request = ActionController::TestRequest.new | |
33 | @response = ActionController::TestResponse.new |
|
33 | @response = ActionController::TestResponse.new | |
34 | User.current = nil |
|
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 | end |
|
37 | end | |
37 |
|
38 | |||
38 | if File.directory?(REPOSITORY_PATH) |
|
39 | if File.directory?(REPOSITORY_PATH) | |
39 | def test_show |
|
40 | def test_show | |
40 | get :show, :id => 3 |
|
41 | get :show, :id => 3 | |
@@ -164,6 +165,16 class RepositoriesMercurialControllerTest < ActionController::TestCase | |||||
164 | :attributes => { :class => 'line-num' }, |
|
165 | :attributes => { :class => 'line-num' }, | |
165 | :sibling => { :tag => 'td', :content => /watcher =/ } |
|
166 | :sibling => { :tag => 'td', :content => /watcher =/ } | |
166 | end |
|
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 | else |
|
178 | else | |
168 | puts "Mercurial test repository NOT FOUND. Skipping functional tests !!!" |
|
179 | puts "Mercurial test repository NOT FOUND. Skipping functional tests !!!" | |
169 | def test_fake; assert true end |
|
180 | def test_fake; assert true end |
@@ -168,14 +168,14 class RepositoriesSubversionControllerTest < ActionController::TestCase | |||||
168 |
|
168 | |||
169 | def test_invalid_revision |
|
169 | def test_invalid_revision | |
170 | get :revision, :id => 1, :rev => 'something_weird' |
|
170 | get :revision, :id => 1, :rev => 'something_weird' | |
171 |
assert_response |
|
171 | assert_response 404 | |
172 | assert_error_tag :content => /was not found/ |
|
172 | assert_error_tag :content => /was not found/ | |
173 | end |
|
173 | end | |
174 |
|
174 | |||
175 | def test_empty_revision |
|
175 | def test_empty_revision | |
176 | ['', ' ', nil].each do |r| |
|
176 | ['', ' ', nil].each do |r| | |
177 | get :revision, :id => 1, :rev => r |
|
177 | get :revision, :id => 1, :rev => r | |
178 |
assert_response |
|
178 | assert_response 404 | |
179 | assert_error_tag :content => /was not found/ |
|
179 | assert_error_tag :content => /was not found/ | |
180 | end |
|
180 | end | |
181 | end |
|
181 | end |
General Comments 0
You need to be logged in to leave comments.
Login now