2011-05-07 10:38:45 +04:00
|
|
|
# Redmine - project management software
|
|
|
|
# Copyright (C) 2006-2011 Jean-Philippe Lang
|
2007-12-14 20:46:45 +03:00
|
|
|
#
|
|
|
|
# This program is free software; you can redistribute it and/or
|
|
|
|
# modify it under the terms of the GNU General Public License
|
|
|
|
# as published by the Free Software Foundation; either version 2
|
|
|
|
# of the License, or (at your option) any later version.
|
2011-05-07 10:38:45 +04:00
|
|
|
#
|
2007-12-14 20:46:45 +03:00
|
|
|
# This program is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU General Public License for more details.
|
2011-05-07 10:38:45 +04:00
|
|
|
#
|
2007-12-14 20:46:45 +03:00
|
|
|
# You should have received a copy of the GNU General Public License
|
|
|
|
# along with this program; if not, write to the Free Software
|
|
|
|
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
|
2010-12-13 02:24:34 +03:00
|
|
|
require File.expand_path('../../test_helper', __FILE__)
|
2007-12-14 20:46:45 +03:00
|
|
|
require 'repositories_controller'
|
|
|
|
|
|
|
|
# Re-raise errors caught by the controller.
|
|
|
|
class RepositoriesController; def rescue_action(e) raise e end; end
|
|
|
|
|
2009-09-13 21:14:35 +04:00
|
|
|
class RepositoriesMercurialControllerTest < ActionController::TestCase
|
2009-05-10 14:54:31 +04:00
|
|
|
fixtures :projects, :users, :roles, :members, :member_roles, :repositories, :enabled_modules
|
2007-12-14 20:46:45 +03:00
|
|
|
|
|
|
|
# No '..' in the repository path
|
2011-05-07 11:25:53 +04:00
|
|
|
REPOSITORY_PATH = RAILS_ROOT.gsub(%r{config\/\.\.}, '') +
|
|
|
|
'/tmp/test/mercurial_repository'
|
2011-03-04 14:07:58 +03:00
|
|
|
CHAR_1_HEX = "\xc3\x9c"
|
2011-05-07 11:25:53 +04:00
|
|
|
PRJ_ID = 3
|
2011-03-22 14:26:15 +03:00
|
|
|
|
2011-05-07 11:25:53 +04:00
|
|
|
ruby19_non_utf8_pass =
|
|
|
|
(RUBY_VERSION >= '1.9' && Encoding.default_external.to_s != 'UTF-8')
|
2007-12-14 20:46:45 +03:00
|
|
|
|
|
|
|
def setup
|
|
|
|
@controller = RepositoriesController.new
|
|
|
|
@request = ActionController::TestRequest.new
|
|
|
|
@response = ActionController::TestResponse.new
|
|
|
|
User.current = nil
|
2011-03-04 07:25:48 +03:00
|
|
|
@repository = Repository::Mercurial.create(
|
2011-03-22 14:26:15 +03:00
|
|
|
:project => Project.find(PRJ_ID),
|
2011-03-04 07:25:48 +03:00
|
|
|
:url => REPOSITORY_PATH,
|
|
|
|
:path_encoding => 'ISO-8859-1'
|
|
|
|
)
|
2011-01-11 08:15:56 +03:00
|
|
|
assert @repository
|
2011-02-16 14:18:18 +03:00
|
|
|
@diff_c_support = true
|
2011-03-04 14:07:58 +03:00
|
|
|
@char_1 = CHAR_1_HEX.dup
|
2011-03-14 11:15:22 +03:00
|
|
|
@tag_char_1 = "tag-#{CHAR_1_HEX}-00"
|
|
|
|
@branch_char_0 = "branch-#{CHAR_1_HEX}-00"
|
|
|
|
@branch_char_1 = "branch-#{CHAR_1_HEX}-01"
|
2011-03-04 14:07:58 +03:00
|
|
|
if @char_1.respond_to?(:force_encoding)
|
|
|
|
@char_1.force_encoding('UTF-8')
|
2011-03-14 11:15:22 +03:00
|
|
|
@tag_char_1.force_encoding('UTF-8')
|
|
|
|
@branch_char_0.force_encoding('UTF-8')
|
|
|
|
@branch_char_1.force_encoding('UTF-8')
|
2011-03-04 14:07:58 +03:00
|
|
|
end
|
2007-12-14 20:46:45 +03:00
|
|
|
end
|
2011-01-11 08:15:56 +03:00
|
|
|
|
2011-03-04 14:07:58 +03:00
|
|
|
if ruby19_non_utf8_pass
|
|
|
|
puts "TODO: Mercurial functional test fails in Ruby 1.9 " +
|
|
|
|
"and Encoding.default_external is not UTF-8. " +
|
2011-05-07 10:38:45 +04:00
|
|
|
"Current value is '#{Encoding.default_external.to_s}'"
|
2011-03-04 14:07:58 +03:00
|
|
|
def test_fake; assert true end
|
|
|
|
elsif File.directory?(REPOSITORY_PATH)
|
2009-08-16 02:41:40 +04:00
|
|
|
def test_show_root
|
2011-03-14 13:23:51 +03:00
|
|
|
@repository.fetch_changesets
|
|
|
|
@repository.reload
|
2011-03-22 14:26:15 +03:00
|
|
|
get :show, :id => PRJ_ID
|
2007-12-20 01:14:03 +03:00
|
|
|
assert_response :success
|
2009-08-16 02:41:40 +04:00
|
|
|
assert_template 'show'
|
2007-12-20 01:14:03 +03:00
|
|
|
assert_not_nil assigns(:entries)
|
2011-01-05 18:02:47 +03:00
|
|
|
assert_equal 4, assigns(:entries).size
|
2011-01-05 18:01:39 +03:00
|
|
|
assert assigns(:entries).detect {|e| e.name == 'images' && e.kind == 'dir'}
|
2007-12-20 01:14:03 +03:00
|
|
|
assert assigns(:entries).detect {|e| e.name == 'sources' && e.kind == 'dir'}
|
2011-01-05 18:01:39 +03:00
|
|
|
assert assigns(:entries).detect {|e| e.name == 'README' && e.kind == 'file'}
|
2011-03-14 13:23:51 +03:00
|
|
|
assert_not_nil assigns(:changesets)
|
|
|
|
assigns(:changesets).size > 0
|
2007-12-20 01:14:03 +03:00
|
|
|
end
|
2011-01-15 13:15:41 +03:00
|
|
|
|
2009-08-16 02:41:40 +04:00
|
|
|
def test_show_directory
|
2011-03-14 13:23:51 +03:00
|
|
|
@repository.fetch_changesets
|
|
|
|
@repository.reload
|
2011-03-22 14:26:15 +03:00
|
|
|
get :show, :id => PRJ_ID, :path => ['images']
|
2007-12-20 01:14:03 +03:00
|
|
|
assert_response :success
|
2009-08-16 02:41:40 +04:00
|
|
|
assert_template 'show'
|
2007-12-20 01:14:03 +03:00
|
|
|
assert_not_nil assigns(:entries)
|
2008-04-06 14:35:55 +04:00
|
|
|
assert_equal ['delete.png', 'edit.png'], assigns(:entries).collect(&:name)
|
2007-12-20 01:14:03 +03:00
|
|
|
entry = assigns(:entries).detect {|e| e.name == 'edit.png'}
|
|
|
|
assert_not_nil entry
|
|
|
|
assert_equal 'file', entry.kind
|
|
|
|
assert_equal 'images/edit.png', entry.path
|
2011-03-14 13:23:51 +03:00
|
|
|
assert_not_nil assigns(:changesets)
|
|
|
|
assigns(:changesets).size > 0
|
2007-12-20 01:14:03 +03:00
|
|
|
end
|
2011-01-09 05:13:54 +03:00
|
|
|
|
2009-08-16 02:41:40 +04:00
|
|
|
def test_show_at_given_revision
|
2011-03-14 13:23:51 +03:00
|
|
|
@repository.fetch_changesets
|
|
|
|
@repository.reload
|
2011-01-09 05:13:54 +03:00
|
|
|
[0, '0', '0885933ad4f6'].each do |r1|
|
2011-03-22 14:26:15 +03:00
|
|
|
get :show, :id => PRJ_ID, :path => ['images'], :rev => r1
|
2011-01-09 05:13:54 +03:00
|
|
|
assert_response :success
|
|
|
|
assert_template 'show'
|
|
|
|
assert_not_nil assigns(:entries)
|
|
|
|
assert_equal ['delete.png'], assigns(:entries).collect(&:name)
|
2011-03-14 13:23:51 +03:00
|
|
|
assert_not_nil assigns(:changesets)
|
|
|
|
assigns(:changesets).size > 0
|
2011-01-09 05:13:54 +03:00
|
|
|
end
|
2008-04-06 14:35:55 +04:00
|
|
|
end
|
2011-01-05 18:03:16 +03:00
|
|
|
|
|
|
|
def test_show_directory_sql_escape_percent
|
2011-03-14 13:23:51 +03:00
|
|
|
@repository.fetch_changesets
|
|
|
|
@repository.reload
|
2011-01-09 05:13:54 +03:00
|
|
|
[13, '13', '3a330eb32958'].each do |r1|
|
2011-05-07 11:25:53 +04:00
|
|
|
get :show, :id => PRJ_ID, :path => ['sql_escape', 'percent%dir'],
|
|
|
|
:rev => r1
|
2011-01-09 05:13:54 +03:00
|
|
|
assert_response :success
|
|
|
|
assert_template 'show'
|
2011-01-05 18:03:16 +03:00
|
|
|
|
2011-01-09 05:13:54 +03:00
|
|
|
assert_not_nil assigns(:entries)
|
2011-05-07 11:25:53 +04:00
|
|
|
assert_equal ['percent%file1.txt', 'percentfile1.txt'],
|
|
|
|
assigns(:entries).collect(&:name)
|
2011-01-09 05:13:54 +03:00
|
|
|
changesets = assigns(:changesets)
|
2011-03-14 14:03:34 +03:00
|
|
|
assert_not_nil changesets
|
2011-03-14 13:23:51 +03:00
|
|
|
assigns(:changesets).size > 0
|
2011-03-14 14:03:34 +03:00
|
|
|
assert_equal %w(13 11 10 9), changesets.collect(&:revision)
|
2011-01-09 05:13:54 +03:00
|
|
|
end
|
2011-01-05 18:03:16 +03:00
|
|
|
end
|
|
|
|
|
2011-05-07 11:25:09 +04:00
|
|
|
def test_show_directory_latin_1_path
|
2011-03-04 14:07:58 +03:00
|
|
|
@repository.fetch_changesets
|
|
|
|
@repository.reload
|
|
|
|
[21, '21', 'adf805632193'].each do |r1|
|
2011-03-22 14:26:15 +03:00
|
|
|
get :show, :id => PRJ_ID, :path => ['latin-1-dir'], :rev => r1
|
2011-03-04 14:07:58 +03:00
|
|
|
assert_response :success
|
|
|
|
assert_template 'show'
|
|
|
|
|
|
|
|
assert_not_nil assigns(:entries)
|
|
|
|
assert_equal ["make-latin-1-file.rb",
|
|
|
|
"test-#{@char_1}-1.txt",
|
|
|
|
"test-#{@char_1}-2.txt",
|
|
|
|
"test-#{@char_1}.txt"], assigns(:entries).collect(&:name)
|
|
|
|
changesets = assigns(:changesets)
|
|
|
|
assert_not_nil changesets
|
2011-03-14 13:36:34 +03:00
|
|
|
assert_equal %w(21 20 19 18 17), changesets.collect(&:revision)
|
2011-03-04 14:07:58 +03:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2011-03-14 16:42:16 +03:00
|
|
|
def test_show_branch
|
|
|
|
@repository.fetch_changesets
|
|
|
|
@repository.reload
|
|
|
|
[
|
|
|
|
'default',
|
|
|
|
@branch_char_1,
|
|
|
|
'branch (1)[2]&,%.-3_4',
|
|
|
|
@branch_char_0,
|
|
|
|
'test_branch.latin-1',
|
|
|
|
'test-branch-00',
|
|
|
|
].each do |bra|
|
2011-03-22 14:26:15 +03:00
|
|
|
get :show, :id => PRJ_ID, :rev => bra
|
2011-03-14 16:42:16 +03:00
|
|
|
assert_response :success
|
|
|
|
assert_template 'show'
|
|
|
|
assert_not_nil assigns(:entries)
|
|
|
|
assert assigns(:entries).size > 0
|
|
|
|
assert_not_nil assigns(:changesets)
|
|
|
|
assigns(:changesets).size > 0
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2011-03-14 16:42:37 +03:00
|
|
|
def test_show_tag
|
|
|
|
@repository.fetch_changesets
|
|
|
|
@repository.reload
|
|
|
|
[
|
|
|
|
@tag_char_1,
|
|
|
|
'tag_test.00',
|
|
|
|
'tag-init-revision'
|
|
|
|
].each do |tag|
|
2011-03-22 14:26:15 +03:00
|
|
|
get :show, :id => PRJ_ID, :rev => tag
|
2011-03-14 16:42:37 +03:00
|
|
|
assert_response :success
|
|
|
|
assert_template 'show'
|
|
|
|
assert_not_nil assigns(:entries)
|
|
|
|
assert assigns(:entries).size > 0
|
|
|
|
assert_not_nil assigns(:changesets)
|
|
|
|
assigns(:changesets).size > 0
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2007-12-20 01:14:03 +03:00
|
|
|
def test_changes
|
2011-03-22 14:26:15 +03:00
|
|
|
get :changes, :id => PRJ_ID, :path => ['images', 'edit.png']
|
2007-12-20 01:14:03 +03:00
|
|
|
assert_response :success
|
|
|
|
assert_template 'changes'
|
|
|
|
assert_tag :tag => 'h2', :content => 'edit.png'
|
|
|
|
end
|
2011-05-07 10:38:45 +04:00
|
|
|
|
2007-12-20 01:14:03 +03:00
|
|
|
def test_entry_show
|
2011-03-22 14:26:15 +03:00
|
|
|
get :entry, :id => PRJ_ID, :path => ['sources', 'watchers_controller.rb']
|
2007-12-20 01:14:03 +03:00
|
|
|
assert_response :success
|
|
|
|
assert_template 'entry'
|
2011-01-05 18:01:39 +03:00
|
|
|
# Line 10
|
2007-12-20 01:14:03 +03:00
|
|
|
assert_tag :tag => 'th',
|
2011-01-05 18:01:39 +03:00
|
|
|
:content => '10',
|
|
|
|
:attributes => { :class => 'line-num' },
|
2007-12-20 01:14:03 +03:00
|
|
|
:sibling => { :tag => 'td', :content => /WITHOUT ANY WARRANTY/ }
|
|
|
|
end
|
2011-03-04 14:07:58 +03:00
|
|
|
|
2011-05-07 11:25:09 +04:00
|
|
|
def test_entry_show_latin_1_path
|
2011-03-04 14:07:58 +03:00
|
|
|
[21, '21', 'adf805632193'].each do |r1|
|
2011-05-07 11:25:09 +04:00
|
|
|
get :entry, :id => PRJ_ID,
|
|
|
|
:path => ['latin-1-dir', "test-#{@char_1}-2.txt"], :rev => r1
|
2011-03-04 14:07:58 +03:00
|
|
|
assert_response :success
|
|
|
|
assert_template 'entry'
|
|
|
|
assert_tag :tag => 'th',
|
|
|
|
:content => '1',
|
|
|
|
:attributes => { :class => 'line-num' },
|
2011-03-22 14:26:15 +03:00
|
|
|
:sibling => { :tag => 'td',
|
|
|
|
:content => /Mercurial is a distributed version control system/ }
|
2011-03-04 14:07:58 +03:00
|
|
|
end
|
|
|
|
end
|
2011-05-07 10:38:45 +04:00
|
|
|
|
2007-12-20 01:14:03 +03:00
|
|
|
def test_entry_download
|
2011-05-07 11:25:53 +04:00
|
|
|
get :entry, :id => PRJ_ID,
|
|
|
|
:path => ['sources', 'watchers_controller.rb'], :format => 'raw'
|
2007-12-20 01:14:03 +03:00
|
|
|
assert_response :success
|
|
|
|
# File content
|
|
|
|
assert @response.body.include?('WITHOUT ANY WARRANTY')
|
|
|
|
end
|
2008-04-27 14:12:15 +04:00
|
|
|
|
2011-03-22 14:26:57 +03:00
|
|
|
def test_entry_binary_force_download
|
|
|
|
get :entry, :id => PRJ_ID, :rev => 1, :path => ['images', 'edit.png']
|
|
|
|
assert_response :success
|
2011-03-22 19:56:52 +03:00
|
|
|
assert_equal 'image/png', @response.content_type
|
2011-03-22 14:26:57 +03:00
|
|
|
end
|
|
|
|
|
2008-04-27 14:12:15 +04:00
|
|
|
def test_directory_entry
|
2011-03-22 14:26:15 +03:00
|
|
|
get :entry, :id => PRJ_ID, :path => ['sources']
|
2008-04-27 14:12:15 +04:00
|
|
|
assert_response :success
|
2009-08-16 02:41:40 +04:00
|
|
|
assert_template 'show'
|
2008-04-27 14:12:15 +04:00
|
|
|
assert_not_nil assigns(:entry)
|
|
|
|
assert_equal 'sources', assigns(:entry).name
|
|
|
|
end
|
2011-03-22 14:26:57 +03:00
|
|
|
|
2007-12-20 01:14:03 +03:00
|
|
|
def test_diff
|
2011-01-11 19:04:28 +03:00
|
|
|
@repository.fetch_changesets
|
|
|
|
@repository.reload
|
2011-01-09 05:13:54 +03:00
|
|
|
[4, '4', 'def6d2f1254a'].each do |r1|
|
|
|
|
# Full diff of changeset 4
|
2011-03-22 14:26:15 +03:00
|
|
|
get :diff, :id => PRJ_ID, :rev => r1
|
2011-01-09 05:13:54 +03:00
|
|
|
assert_response :success
|
|
|
|
assert_template 'diff'
|
2011-02-16 14:17:37 +03:00
|
|
|
if @diff_c_support
|
2011-01-11 08:15:56 +03:00
|
|
|
# Line 22 removed
|
|
|
|
assert_tag :tag => 'th',
|
|
|
|
:content => '22',
|
2011-05-07 10:38:45 +04:00
|
|
|
:sibling => { :tag => 'td',
|
2011-01-11 08:15:56 +03:00
|
|
|
:attributes => { :class => /diff_out/ },
|
|
|
|
:content => /def remove/ }
|
2011-01-11 19:04:28 +03:00
|
|
|
assert_tag :tag => 'h2', :content => /4:def6d2f1254a/
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
def test_diff_two_revs
|
|
|
|
@repository.fetch_changesets
|
|
|
|
@repository.reload
|
|
|
|
[2, '400bb8672109', '400', 400].each do |r1|
|
|
|
|
[4, 'def6d2f1254a'].each do |r2|
|
2011-03-22 14:26:15 +03:00
|
|
|
get :diff, :id => PRJ_ID, :rev => r1,
|
|
|
|
:rev_to => r2
|
2011-01-11 19:04:28 +03:00
|
|
|
assert_response :success
|
|
|
|
assert_template 'diff'
|
|
|
|
|
|
|
|
diff = assigns(:diff)
|
|
|
|
assert_not_nil diff
|
|
|
|
assert_tag :tag => 'h2', :content => /4:def6d2f1254a 2:400bb8672109/
|
2011-01-11 08:15:56 +03:00
|
|
|
end
|
2011-01-09 05:13:54 +03:00
|
|
|
end
|
2007-12-20 01:14:03 +03:00
|
|
|
end
|
2011-01-09 04:30:18 +03:00
|
|
|
|
2011-05-07 11:25:09 +04:00
|
|
|
def test_diff_latin_1_path
|
2011-03-04 14:07:58 +03:00
|
|
|
[21, 'adf805632193'].each do |r1|
|
2011-03-22 14:26:15 +03:00
|
|
|
get :diff, :id => PRJ_ID, :rev => r1
|
2011-03-04 14:07:58 +03:00
|
|
|
assert_response :success
|
|
|
|
assert_template 'diff'
|
|
|
|
assert_tag :tag => 'th',
|
|
|
|
:content => '2',
|
2011-05-07 11:25:09 +04:00
|
|
|
:sibling => {:tag => 'td',
|
|
|
|
:attributes => { :class => /diff_in/ },
|
|
|
|
:content => /It is written in Python/ }
|
2011-03-04 14:07:58 +03:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2007-12-20 01:14:03 +03:00
|
|
|
def test_annotate
|
2011-03-22 14:26:15 +03:00
|
|
|
get :annotate, :id => PRJ_ID, :path => ['sources', 'watchers_controller.rb']
|
2007-12-20 01:14:03 +03:00
|
|
|
assert_response :success
|
|
|
|
assert_template 'annotate'
|
2011-01-03 13:45:44 +03:00
|
|
|
# Line 23, revision 4:def6d2f1254a
|
|
|
|
assert_tag :tag => 'th',
|
|
|
|
:content => '23',
|
|
|
|
:attributes => { :class => 'line-num' },
|
|
|
|
:sibling =>
|
|
|
|
{
|
|
|
|
:tag => 'td',
|
|
|
|
:attributes => { :class => 'revision' },
|
2011-01-09 04:30:18 +03:00
|
|
|
:child => { :tag => 'a', :content => '4:def6d2f1254a' }
|
2011-01-03 13:45:44 +03:00
|
|
|
}
|
|
|
|
assert_tag :tag => 'th',
|
|
|
|
:content => '23',
|
|
|
|
:attributes => { :class => 'line-num' },
|
|
|
|
:sibling =>
|
|
|
|
{
|
|
|
|
:tag => 'td' ,
|
|
|
|
:content => 'jsmith' ,
|
|
|
|
:attributes => { :class => 'author' },
|
|
|
|
}
|
|
|
|
assert_tag :tag => 'th',
|
|
|
|
:content => '23',
|
|
|
|
:attributes => { :class => 'line-num' },
|
2007-12-20 01:14:03 +03:00
|
|
|
:sibling => { :tag => 'td', :content => /watcher =/ }
|
|
|
|
end
|
2011-01-13 15:04:51 +03:00
|
|
|
|
2011-01-21 16:22:28 +03:00
|
|
|
def test_annotate_at_given_revision
|
|
|
|
@repository.fetch_changesets
|
|
|
|
@repository.reload
|
|
|
|
[2, '400bb8672109', '400', 400].each do |r1|
|
2011-05-07 11:25:53 +04:00
|
|
|
get :annotate, :id => PRJ_ID, :rev => r1,
|
|
|
|
:path => ['sources', 'watchers_controller.rb']
|
2011-01-21 16:22:28 +03:00
|
|
|
assert_response :success
|
|
|
|
assert_template 'annotate'
|
|
|
|
assert_tag :tag => 'h2', :content => /@ 2:400bb8672109/
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2011-05-07 11:25:09 +04:00
|
|
|
def test_annotate_latin_1_path
|
2011-03-04 14:07:58 +03:00
|
|
|
[21, '21', 'adf805632193'].each do |r1|
|
2011-05-07 11:25:09 +04:00
|
|
|
get :annotate, :id => PRJ_ID,
|
|
|
|
:path => ['latin-1-dir', "test-#{@char_1}-2.txt"], :rev => r1
|
2011-03-04 14:07:58 +03:00
|
|
|
assert_response :success
|
|
|
|
assert_template 'annotate'
|
|
|
|
assert_tag :tag => 'th',
|
|
|
|
:content => '1',
|
|
|
|
:attributes => { :class => 'line-num' },
|
|
|
|
:sibling =>
|
|
|
|
{
|
|
|
|
:tag => 'td',
|
|
|
|
:attributes => { :class => 'revision' },
|
|
|
|
:child => { :tag => 'a', :content => '20:709858aafd1b' }
|
|
|
|
}
|
|
|
|
assert_tag :tag => 'th',
|
|
|
|
:content => '1',
|
|
|
|
:attributes => { :class => 'line-num' },
|
|
|
|
:sibling =>
|
|
|
|
{
|
|
|
|
:tag => 'td' ,
|
|
|
|
:content => 'jsmith' ,
|
|
|
|
:attributes => { :class => 'author' },
|
|
|
|
}
|
|
|
|
assert_tag :tag => 'th',
|
|
|
|
:content => '1',
|
|
|
|
:attributes => { :class => 'line-num' },
|
2011-03-22 14:26:15 +03:00
|
|
|
:sibling => { :tag => 'td',
|
|
|
|
:content => /Mercurial is a distributed version control system/ }
|
2011-03-04 14:07:58 +03:00
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2011-01-13 15:04:51 +03:00
|
|
|
def test_empty_revision
|
|
|
|
@repository.fetch_changesets
|
|
|
|
@repository.reload
|
|
|
|
['', ' ', nil].each do |r|
|
2011-03-22 14:26:15 +03:00
|
|
|
get :revision, :id => PRJ_ID, :rev => r
|
2011-01-14 23:22:36 +03:00
|
|
|
assert_response 404
|
2011-01-13 15:04:51 +03:00
|
|
|
assert_error_tag :content => /was not found/
|
|
|
|
end
|
|
|
|
end
|
2007-12-20 01:14:03 +03:00
|
|
|
else
|
|
|
|
puts "Mercurial test repository NOT FOUND. Skipping functional tests !!!"
|
|
|
|
def test_fake; assert true end
|
2007-12-14 20:46:45 +03:00
|
|
|
end
|
|
|
|
end
|