summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>2011-01-14 23:37:30 +0000
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>2011-01-14 23:37:30 +0000
commit6188b9eddba7066a691e2a657ebd208391e69272 (patch)
tree0a36b96712fac9136938d36a9c26f9350e2a8dd6 /test
parent96c4dc3f1e4ee8f99cc0257a5d5258b60882931c (diff)
downloadredmine-6188b9eddba7066a691e2a657ebd208391e69272.tar.gz
redmine-6188b9eddba7066a691e2a657ebd208391e69272.zip
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
Diffstat (limited to 'test')
-rw-r--r--test/functional/repositories_git_controller_test.rb2
-rw-r--r--test/functional/repositories_mercurial_controller_test.rb15
-rw-r--r--test/functional/repositories_subversion_controller_test.rb4
3 files changed, 16 insertions, 5 deletions
diff --git a/test/functional/repositories_git_controller_test.rb b/test/functional/repositories_git_controller_test.rb
index e08c41b48..53b5ea7cc 100644
--- a/test/functional/repositories_git_controller_test.rb
+++ b/test/functional/repositories_git_controller_test.rb
@@ -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
diff --git a/test/functional/repositories_mercurial_controller_test.rb b/test/functional/repositories_mercurial_controller_test.rb
index b577da87e..170e4f8e8 100644
--- a/test/functional/repositories_mercurial_controller_test.rb
+++ b/test/functional/repositories_mercurial_controller_test.rb
@@ -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
diff --git a/test/functional/repositories_subversion_controller_test.rb b/test/functional/repositories_subversion_controller_test.rb
index 5478cee27..1a13797d8 100644
--- a/test/functional/repositories_subversion_controller_test.rb
+++ b/test/functional/repositories_subversion_controller_test.rb
@@ -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