Merged r4710 and r4714 from trunk.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/1.1-stable@4716 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
96c4dc3f1e
commit
6188b9eddb
|
@ -225,7 +225,7 @@ class RepositoriesController < ApplicationController
|
|||
end
|
||||
|
||||
def show_error_not_found
|
||||
render_error l(:error_scm_not_found)
|
||||
render_error :message => l(:error_scm_not_found), :status => 404
|
||||
end
|
||||
|
||||
# Handler for Redmine::Scm::Adapters::CommandFailed exception
|
||||
|
|
|
@ -192,7 +192,7 @@ class RepositoriesGitControllerTest < ActionController::TestCase
|
|||
@repository.reload
|
||||
['', ' ', nil].each do |r|
|
||||
get :revision, :id => 1, :rev => r
|
||||
assert_response 500
|
||||
assert_response 404
|
||||
assert_error_tag :content => /was not found/
|
||||
end
|
||||
end
|
||||
|
|
|
@ -32,9 +32,10 @@ class RepositoriesMercurialControllerTest < ActionController::TestCase
|
|||
@request = ActionController::TestRequest.new
|
||||
@response = ActionController::TestResponse.new
|
||||
User.current = nil
|
||||
Repository::Mercurial.create(:project => Project.find(3), :url => REPOSITORY_PATH)
|
||||
@repository = Repository::Mercurial.create(:project => Project.find(3), :url => REPOSITORY_PATH)
|
||||
assert @repository
|
||||
end
|
||||
|
||||
|
||||
if File.directory?(REPOSITORY_PATH)
|
||||
def test_show
|
||||
get :show, :id => 3
|
||||
|
@ -164,6 +165,16 @@ class RepositoriesMercurialControllerTest < ActionController::TestCase
|
|||
:attributes => { :class => 'line-num' },
|
||||
:sibling => { :tag => 'td', :content => /watcher =/ }
|
||||
end
|
||||
|
||||
def test_empty_revision
|
||||
@repository.fetch_changesets
|
||||
@repository.reload
|
||||
['', ' ', nil].each do |r|
|
||||
get :revision, :id => 3, :rev => r
|
||||
assert_response 404
|
||||
assert_error_tag :content => /was not found/
|
||||
end
|
||||
end
|
||||
else
|
||||
puts "Mercurial test repository NOT FOUND. Skipping functional tests !!!"
|
||||
def test_fake; assert true end
|
||||
|
|
|
@ -168,14 +168,14 @@ class RepositoriesSubversionControllerTest < ActionController::TestCase
|
|||
|
||||
def test_invalid_revision
|
||||
get :revision, :id => 1, :rev => 'something_weird'
|
||||
assert_response 500
|
||||
assert_response 404
|
||||
assert_error_tag :content => /was not found/
|
||||
end
|
||||
|
||||
def test_empty_revision
|
||||
['', ' ', nil].each do |r|
|
||||
get :revision, :id => 1, :rev => r
|
||||
assert_response 500
|
||||
assert_response 404
|
||||
assert_error_tag :content => /was not found/
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue