@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
@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
: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
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