##// END OF EJS Templates
fix svn raw diff failure on svn version 1.6.17 (revision 1128011)...
fix svn raw diff failure on svn version 1.6.17 (revision 1128011) git-svn-id: http://svn.redmine.org/redmine/trunk@12424 e93f8b46-1217-0410-a6f0-8f06a7374b81

File last commit:

r12149:f9b554307530
r12149:f9b554307530
Show More
repositories_subversion_controller_test.rb
425 lines | 15.4 KiB | text/x-ruby | RubyLexer
/ test / functional / repositories_subversion_controller_test.rb
Jean-Philippe Lang
Fixes subversion tests not running on win32....
r5055 # Redmine - project management software
Jean-Philippe Lang
Copyright for 2013 (#12788)....
r10939 # Copyright (C) 2006-2013 Jean-Philippe Lang
Jean-Philippe Lang
Added some functional tests (projects and repositories)....
r968 #
# 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.
Toshi MARUYAMA
scm: subversion: remove trailing white-spaces from functional test....
r5581 #
Jean-Philippe Lang
Added some functional tests (projects and repositories)....
r968 # 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.
Toshi MARUYAMA
scm: subversion: remove trailing white-spaces from functional test....
r5581 #
Jean-Philippe Lang
Added some functional tests (projects and repositories)....
r968 # 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.
Jean-Baptiste Barth
Use absolute paths in test/**/* requires for Ruby 1.9.2 compatibility. #4050...
r4395 require File.expand_path('../../test_helper', __FILE__)
Jean-Philippe Lang
Added some functional tests (projects and repositories)....
r968
Eric Davis
Upgraded to Rails 2.3.4 (#3597)...
r2773 class RepositoriesSubversionControllerTest < ActionController::TestCase
Jean-Philippe Lang
Test class cleanup....
r7917 tests RepositoriesController
Jean-Philippe Lang
Allows multiple roles on the same project (#706). Prerequisite for user groups feature....
r2627 fixtures :projects, :users, :roles, :members, :member_roles, :enabled_modules,
Jean-Philippe Lang
Functional tests fail when run on their own (#1895)....
r1826 :repositories, :issues, :issue_statuses, :changesets, :changes,
:issue_categories, :enumerations, :custom_fields, :custom_values, :trackers
Jean-Philippe Lang
Added some functional tests (projects and repositories)....
r968
Toshi MARUYAMA
scm: subversion: change some functional tests project id from 1 to 3....
r4776 PRJ_ID = 3
Toshi MARUYAMA
scm: subversion: define NUM_REV as the number of test repository revisions at functional test...
r7052 NUM_REV = 11
Toshi MARUYAMA
scm: subversion: change some functional tests project id from 1 to 3....
r4776
Jean-Philippe Lang
Added some functional tests (projects and repositories)....
r968 def setup
Jean-Philippe Lang
Fixed: CVS repository doesn't work if port is used in the url (#653)....
r1142 Setting.default_language = 'en'
Jean-Philippe Lang
Added some functional tests (projects and repositories)....
r968 User.current = nil
Toshi MARUYAMA
scm: subversion: change some functional tests project id from 1 to 3....
r4776
@project = Project.find(PRJ_ID)
@repository = Repository::Subversion.create(:project => @project,
Jean-Philippe Lang
Fixes subversion tests not running on win32....
r5055 :url => self.class.subversion_repository_url)
Toshi MARUYAMA
scm: subversion: change some functional tests project id from 1 to 3....
r4776 assert @repository
Jean-Philippe Lang
Added some functional tests (projects and repositories)....
r968 end
Jean-Philippe Lang
Adds test helpers for test repositories....
r3606 if repository_configured?('subversion')
Jean-Philippe Lang
Resourcified repositories for CRUD operations to prepare for multiple SCM per project (#779)....
r8528 def test_new
Jean-Philippe Lang
Adds functional tests for repository creation/update....
r7916 @request.session[:user_id] = 1
@project.repository.destroy
Jean-Philippe Lang
Resourcified repositories for CRUD operations to prepare for multiple SCM per project (#779)....
r8528 get :new, :project_id => 'subproject1', :repository_scm => 'Subversion'
Jean-Philippe Lang
Adds functional tests for repository creation/update....
r7916 assert_response :success
Jean-Philippe Lang
Resourcified repositories for CRUD operations to prepare for multiple SCM per project (#779)....
r8528 assert_template 'new'
Jean-Philippe Lang
Adds functional tests for repository creation/update....
r7916 assert_kind_of Repository::Subversion, assigns(:repository)
assert assigns(:repository).new_record?
end
Jean-Philippe Lang
Added some functional tests (projects and repositories)....
r968 def test_show
Toshi MARUYAMA
Rails3: scm: subversion: fix error of test_show at unit model test...
r7053 assert_equal 0, @repository.changesets.count
Toshi MARUYAMA
scm: subversion: change some functional tests project id from 1 to 3....
r4776 @repository.fetch_changesets
Toshi MARUYAMA
Rails3: scm: subversion: fix error of test_show at unit model test...
r7053 @project.reload
assert_equal NUM_REV, @repository.changesets.count
Toshi MARUYAMA
scm: subversion: change some functional tests project id from 1 to 3....
r4776 get :show, :id => PRJ_ID
Jean-Philippe Lang
Added some functional tests (projects and repositories)....
r968 assert_response :success
assert_template 'show'
assert_not_nil assigns(:entries)
assert_not_nil assigns(:changesets)
Jean-Philippe Lang
Do not show revisions links and field on filesystem repositories....
r8545
Jean-Philippe Lang
Removed duplicated test....
r8546 entry = assigns(:entries).detect {|e| e.name == 'subversion_test'}
assert_not_nil entry
assert_equal 'dir', entry.kind
Jean-Philippe Lang
Merged rails-3.2 branch....
r9346 assert_select 'tr.dir a[href=/projects/subproject1/repository/show/subversion_test]'
Jean-Philippe Lang
Removed duplicated test....
r8546
Jean-Philippe Lang
Do not show revisions links and field on filesystem repositories....
r8545 assert_tag 'input', :attributes => {:name => 'rev'}
assert_tag 'a', :content => 'Statistics'
assert_tag 'a', :content => 'Atom'
Toshi MARUYAMA
scm: fix broken main repository 'root' link...
r9430 assert_tag :tag => 'a',
:attributes => {:href => '/projects/subproject1/repository'},
:content => 'root'
Jean-Philippe Lang
Added some functional tests (projects and repositories)....
r968 end
Toshi MARUYAMA
scm: subversion: code clean up functional test....
r5441
Jean-Philippe Lang
Merged rails-3.2 branch....
r9346 def test_show_non_default
Repository::Subversion.create(:project => @project,
:url => self.class.subversion_repository_url,
:is_default => false, :identifier => 'svn')
get :show, :id => PRJ_ID, :repository_id => 'svn'
assert_response :success
assert_template 'show'
assert_select 'tr.dir a[href=/projects/subproject1/repository/svn/show/subversion_test]'
# Repository menu should link to the main repo
assert_select '#main-menu a[href=/projects/subproject1/repository]'
end
Jean-Philippe Lang
Added some functional tests (projects and repositories)....
r968 def test_browse_directory
Toshi MARUYAMA
Rails3: scm: subversion: fix error of test_browse_directory at functional test...
r7076 assert_equal 0, @repository.changesets.count
Toshi MARUYAMA
scm: subversion: change some functional tests project id from 1 to 3....
r4776 @repository.fetch_changesets
Toshi MARUYAMA
Rails3: scm: subversion: fix error of test_browse_directory at functional test...
r7076 @project.reload
assert_equal NUM_REV, @repository.changesets.count
Toshi MARUYAMA
Rails3: test: scm: subversion: use "repository_path_hash" for path param...
r8810 get :show, :id => PRJ_ID, :path => repository_path_hash(['subversion_test'])[:param]
Jean-Philippe Lang
Added some functional tests (projects and repositories)....
r968 assert_response :success
Eric Davis
Added branch and tag support to the git repository viewer. (#1406)...
r2735 assert_template 'show'
Jean-Philippe Lang
Added some functional tests (projects and repositories)....
r968 assert_not_nil assigns(:entries)
Toshi MARUYAMA
scm: subversion: code clean up test_browse_directory at functional test...
r7064 assert_equal [
'[folder_with_brackets]', 'folder', '.project',
'helloworld.c', 'textfile.txt'
],
assigns(:entries).collect(&:name)
Jean-Philippe Lang
Added some functional tests (projects and repositories)....
r968 entry = assigns(:entries).detect {|e| e.name == 'helloworld.c'}
assert_equal 'file', entry.kind
assert_equal 'subversion_test/helloworld.c', entry.path
Jean-Philippe Lang
Adds mime type specific css classes to the SCM browser....
r2580 assert_tag :a, :content => 'helloworld.c', :attributes => { :class => /text\-x\-c/ }
Jean-Philippe Lang
Added some functional tests (projects and repositories)....
r968 end
Jean-Philippe Lang
Fix repository browsing at given revision for various scm and add tests for this....
r1314
def test_browse_at_given_revision
Toshi MARUYAMA
Rails3: scm: subversion: fix error of test_browse_at_given_revision at functional test...
r7077 assert_equal 0, @repository.changesets.count
Toshi MARUYAMA
scm: subversion: change some functional tests project id from 1 to 3....
r4776 @repository.fetch_changesets
Toshi MARUYAMA
Rails3: scm: subversion: fix error of test_browse_at_given_revision at functional test...
r7077 @project.reload
assert_equal NUM_REV, @repository.changesets.count
Toshi MARUYAMA
Rails3: test: scm: subversion: use "repository_path_hash" for path param...
r8810 get :show, :id => PRJ_ID, :path => repository_path_hash(['subversion_test'])[:param],
:rev => 4
Jean-Philippe Lang
Fix repository browsing at given revision for various scm and add tests for this....
r1314 assert_response :success
Eric Davis
Added branch and tag support to the git repository viewer. (#1406)...
r2735 assert_template 'show'
Jean-Philippe Lang
Fix repository browsing at given revision for various scm and add tests for this....
r1314 assert_not_nil assigns(:entries)
Toshi MARUYAMA
scm: subversion: code clean up functional test....
r5441 assert_equal ['folder', '.project', 'helloworld.c', 'helloworld.rb', 'textfile.txt'],
assigns(:entries).collect(&:name)
Jean-Philippe Lang
Fix repository browsing at given revision for various scm and add tests for this....
r1314 end
Toshi MARUYAMA
scm: subversion: code clean up functional test....
r5441
Jean-Philippe Lang
SCM:...
r2744 def test_file_changes
Toshi MARUYAMA
Rails3: scm: subversion: fix error of test_file_changes at functional test...
r7078 assert_equal 0, @repository.changesets.count
Toshi MARUYAMA
scm: subversion: change some functional tests project id from 1 to 3....
r4776 @repository.fetch_changesets
Toshi MARUYAMA
Rails3: scm: subversion: fix error of test_file_changes at functional test...
r7078 @project.reload
assert_equal NUM_REV, @repository.changesets.count
Toshi MARUYAMA
Rails3: test: scm: subversion: use "repository_path_hash" for path param...
r8810 get :changes, :id => PRJ_ID,
:path => repository_path_hash(['subversion_test', 'folder', 'helloworld.rb'])[:param]
Jean-Philippe Lang
Display svn properties in the browser, svn >= 1.5.0 only (#1581)....
r1613 assert_response :success
assert_template 'changes'
Toshi MARUYAMA
scm: subversion: remove trailing white-spaces from functional test....
r5581
Jean-Philippe Lang
SCM:...
r2739 changesets = assigns(:changesets)
assert_not_nil changesets
assert_equal %w(6 3 2), changesets.collect(&:revision)
Toshi MARUYAMA
scm: subversion: remove trailing white-spaces from functional test....
r5581
Jean-Philippe Lang
Fixes a test failure with svn < 1.5 (#2455)....
r2247 # svn properties displayed with svn >= 1.5 only
if Redmine::Scm::Adapters::SubversionAdapter.client_version_above?([1, 5, 0])
assert_not_nil assigns(:properties)
assert_equal 'native', assigns(:properties)['svn:eol-style']
assert_tag :ul,
:child => { :tag => 'li',
:child => { :tag => 'b', :content => 'svn:eol-style' },
:child => { :tag => 'span', :content => 'native' } }
end
Jean-Philippe Lang
Display svn properties in the browser, svn >= 1.5.0 only (#1581)....
r1613 end
Jean-Philippe Lang
SCM:...
r2744
def test_directory_changes
Toshi MARUYAMA
Rails3: scm: subversion: fix error of test_directory_changes at functional test...
r7079 assert_equal 0, @repository.changesets.count
Toshi MARUYAMA
scm: subversion: change some functional tests project id from 1 to 3....
r4776 @repository.fetch_changesets
Toshi MARUYAMA
Rails3: scm: subversion: fix error of test_directory_changes at functional test...
r7079 @project.reload
assert_equal NUM_REV, @repository.changesets.count
Toshi MARUYAMA
Rails3: test: scm: subversion: use "repository_path_hash" for path param...
r8810 get :changes, :id => PRJ_ID,
:path => repository_path_hash(['subversion_test', 'folder'])[:param]
Jean-Philippe Lang
SCM:...
r2744 assert_response :success
assert_template 'changes'
Toshi MARUYAMA
scm: subversion: code clean up functional test....
r5441
Jean-Philippe Lang
SCM:...
r2744 changesets = assigns(:changesets)
assert_not_nil changesets
Jean-Philippe Lang
Fixed: RepositoriesController#revision may show wrong revision (#3779)....
r2784 assert_equal %w(10 9 7 6 5 2), changesets.collect(&:revision)
Jean-Philippe Lang
SCM:...
r2744 end
Toshi MARUYAMA
scm: subversion: code clean up functional test....
r5441
Jean-Philippe Lang
Added some functional tests (projects and repositories)....
r968 def test_entry
Toshi MARUYAMA
Rails3: scm: subversion: fix error of test_entry at functional test...
r7080 assert_equal 0, @repository.changesets.count
Toshi MARUYAMA
scm: subversion: change some functional tests project id from 1 to 3....
r4776 @repository.fetch_changesets
Toshi MARUYAMA
Rails3: scm: subversion: fix error of test_entry at functional test...
r7080 @project.reload
assert_equal NUM_REV, @repository.changesets.count
Toshi MARUYAMA
Rails3: test: scm: subversion: use "repository_path_hash" for path param...
r8810 get :entry, :id => PRJ_ID,
:path => repository_path_hash(['subversion_test', 'helloworld.c'])[:param]
Jean-Philippe Lang
Added some functional tests (projects and repositories)....
r968 assert_response :success
assert_template 'entry'
end
Toshi MARUYAMA
scm: subversion: code clean up functional test....
r5441
Jean-Philippe Lang
Limit the size of repository files displayed inline too....
r2442 def test_entry_should_send_if_too_big
Toshi MARUYAMA
Rails3: scm: subversion: fix error of test_entry_should_send_if_too_big at functional test...
r7081 assert_equal 0, @repository.changesets.count
Toshi MARUYAMA
scm: subversion: change some functional tests project id from 1 to 3....
r4776 @repository.fetch_changesets
Toshi MARUYAMA
Rails3: scm: subversion: fix error of test_entry_should_send_if_too_big at functional test...
r7081 @project.reload
assert_equal NUM_REV, @repository.changesets.count
Jean-Philippe Lang
Limit the size of repository files displayed inline too....
r2442 # no files in the test repo is larger than 1KB...
with_settings :file_max_size_displayed => 0 do
Toshi MARUYAMA
Rails3: test: scm: subversion: use "repository_path_hash" for path param...
r8810 get :entry, :id => PRJ_ID,
:path => repository_path_hash(['subversion_test', 'helloworld.c'])[:param]
Jean-Philippe Lang
Limit the size of repository files displayed inline too....
r2442 assert_response :success
Toshi MARUYAMA
scm: subversion: code clean up test_entry_should_send_if_too_big at functional test...
r7065 assert_equal 'attachment; filename="helloworld.c"',
@response.headers['Content-Disposition']
Jean-Philippe Lang
Limit the size of repository files displayed inline too....
r2442 end
end
Toshi MARUYAMA
scm: subversion: code clean up functional test....
r5441
Jean-Philippe Lang
Show repository images inline when clicking 'View' (#10362)....
r9593 def test_entry_should_send_images_inline
get :entry, :id => PRJ_ID,
:path => repository_path_hash(['subversion_test', 'folder', 'subfolder', 'rubylogo.gif'])[:param]
assert_response :success
assert_equal 'inline; filename="rubylogo.gif"', response.headers['Content-Disposition']
end
Jean-Philippe Lang
Fixed: view file at given revision with CVS....
r1539 def test_entry_at_given_revision
Toshi MARUYAMA
Rails3: scm: subversion: fix error of test_entry_at_given_revision at functional test...
r7082 assert_equal 0, @repository.changesets.count
Toshi MARUYAMA
scm: subversion: change some functional tests project id from 1 to 3....
r4776 @repository.fetch_changesets
Toshi MARUYAMA
Rails3: scm: subversion: fix error of test_entry_at_given_revision at functional test...
r7082 @project.reload
assert_equal NUM_REV, @repository.changesets.count
Toshi MARUYAMA
Rails3: test: scm: subversion: use "repository_path_hash" for path param...
r8810 get :entry, :id => PRJ_ID,
:path => repository_path_hash(['subversion_test', 'helloworld.rb'])[:param],
:rev => 2
Jean-Philippe Lang
Fixed: view file at given revision with CVS....
r1539 assert_response :success
assert_template 'entry'
# this line was removed in r3 and file was moved in r6
assert_tag :tag => 'td', :attributes => { :class => /line-code/},
:content => /Here's the code/
end
Toshi MARUYAMA
scm: subversion: code clean up functional test....
r5441
Jean-Philippe Lang
Fixed RepositoriesController: undefined local variable or method `show_error' (broken by r1094)....
r1090 def test_entry_not_found
Toshi MARUYAMA
Rails3: scm: subversion: fix error of test_entry_not_found at functional test...
r7083 assert_equal 0, @repository.changesets.count
Toshi MARUYAMA
scm: subversion: change some functional tests project id from 1 to 3....
r4776 @repository.fetch_changesets
Toshi MARUYAMA
Rails3: scm: subversion: fix error of test_entry_not_found at functional test...
r7083 @project.reload
assert_equal NUM_REV, @repository.changesets.count
Toshi MARUYAMA
Rails3: test: scm: subversion: use "repository_path_hash" for path param...
r8810 get :entry, :id => PRJ_ID,
:path => repository_path_hash(['subversion_test', 'zzz.c'])[:param]
Eric Davis
Fix the tests that were broken by r4286:...
r4175 assert_tag :tag => 'p', :attributes => { :id => /errorExplanation/ },
Toshi MARUYAMA
Rails3: test: scm: subversion: use "repository_path_hash" for path param...
r8810 :content => /The entry or revision was not found in the repository/
Jean-Philippe Lang
Fixed RepositoriesController: undefined local variable or method `show_error' (broken by r1094)....
r1090 end
Toshi MARUYAMA
scm: subversion: code clean up functional test....
r5441
Jean-Philippe Lang
Added some functional tests (projects and repositories)....
r968 def test_entry_download
Toshi MARUYAMA
Rails3: scm: subversion: fix error of test_entry_download at functional test...
r7084 assert_equal 0, @repository.changesets.count
Toshi MARUYAMA
scm: subversion: change some functional tests project id from 1 to 3....
r4776 @repository.fetch_changesets
Toshi MARUYAMA
Rails3: scm: subversion: fix error of test_entry_download at functional test...
r7084 @project.reload
assert_equal NUM_REV, @repository.changesets.count
Toshi MARUYAMA
route: scm: split entry and raw actions...
r9442 get :raw, :id => PRJ_ID,
:path => repository_path_hash(['subversion_test', 'helloworld.c'])[:param]
Jean-Philippe Lang
Added some functional tests (projects and repositories)....
r968 assert_response :success
Jean-Philippe Lang
Limit the size of repository files displayed inline too....
r2442 assert_equal 'attachment; filename="helloworld.c"', @response.headers['Content-Disposition']
Jean-Philippe Lang
Added some functional tests (projects and repositories)....
r968 end
Toshi MARUYAMA
scm: subversion: code clean up functional test....
r5441
Jean-Philippe Lang
Fixed: Links to repository directories don't work (#1119)....
r1350 def test_directory_entry
Toshi MARUYAMA
Rails3: scm: subversion: fix error of test_directory_entry at functional test...
r7066 assert_equal 0, @repository.changesets.count
Toshi MARUYAMA
scm: subversion: change some functional tests project id from 1 to 3....
r4776 @repository.fetch_changesets
Toshi MARUYAMA
Rails3: scm: subversion: fix error of test_directory_entry at functional test...
r7066 @project.reload
assert_equal NUM_REV, @repository.changesets.count
Toshi MARUYAMA
Rails3: test: scm: subversion: use "repository_path_hash" for path param...
r8810 get :entry, :id => PRJ_ID,
:path => repository_path_hash(['subversion_test', 'folder'])[:param]
Jean-Philippe Lang
Fixed: Links to repository directories don't work (#1119)....
r1350 assert_response :success
Eric Davis
Added branch and tag support to the git repository viewer. (#1406)...
r2735 assert_template 'show'
Jean-Philippe Lang
Fixed: Links to repository directories don't work (#1119)....
r1350 assert_not_nil assigns(:entry)
assert_equal 'folder', assigns(:entry).name
end
Toshi MARUYAMA
scm: subversion: code clean up functional test....
r5441
Toshi MARUYAMA
scm: subversion: change some functional tests project id from 1 to 3....
r4776 # TODO: this test needs fixtures.
Jean-Philippe Lang
Fixed: View differences for individual file of a changeset fails if the subversion repository URL doesn't point to the repository root (#1209, #1262, #1275)....
r1432 def test_revision
get :revision, :id => 1, :rev => 2
assert_response :success
assert_template 'revision'
Jean-Philippe Lang
Use assert_select instead of assert_tag....
r9925
assert_select 'ul' do
assert_select 'li' do
# link to the entry at rev 2
assert_select 'a[href=?]', '/projects/ecookbook/repository/revisions/2/entry/test/some/path/in/the/repo', :text => 'repo'
# link to partial diff
assert_select 'a[href=?]', '/projects/ecookbook/repository/revisions/2/diff/test/some/path/in/the/repo'
end
end
Jean-Philippe Lang
Fixed: View differences for individual file of a changeset fails if the subversion repository URL doesn't point to the repository root (#1209, #1262, #1275)....
r1432 end
Toshi MARUYAMA
scm: subversion: code clean up functional test....
r5441
Jean-Philippe Lang
Restore rev param validation that was removed in r2840....
r4428 def test_invalid_revision
Toshi MARUYAMA
Rails3: scm: subversion: fix error of test_invalid_revision at functional test...
r7067 assert_equal 0, @repository.changesets.count
Toshi MARUYAMA
scm: subversion: change some functional tests project id from 1 to 3....
r4776 @repository.fetch_changesets
Toshi MARUYAMA
Rails3: scm: subversion: fix error of test_invalid_revision at functional test...
r7067 @project.reload
assert_equal NUM_REV, @repository.changesets.count
Toshi MARUYAMA
scm: subversion: change some functional tests project id from 1 to 3....
r4776 get :revision, :id => PRJ_ID, :rev => 'something_weird'
Jean-Philippe Lang
Respond with 404 instead of 500 when revision/entry is not found in the repository (#7307)....
r4590 assert_response 404
Jean-Philippe Lang
Restore rev param validation that was removed in r2840....
r4428 assert_error_tag :content => /was not found/
end
Toshi MARUYAMA
scm: fix error on revision page for empty revision (#7307)....
r4583
Toshi MARUYAMA
scm: fix diff revision param validation....
r4740 def test_invalid_revision_diff
Toshi MARUYAMA
scm: subversion: change some functional tests project id from 1 to 3....
r4776 get :diff, :id => PRJ_ID, :rev => '1', :rev_to => 'something_weird'
Toshi MARUYAMA
scm: fix diff revision param validation....
r4740 assert_response 404
assert_error_tag :content => /was not found/
end
Toshi MARUYAMA
scm: fix error on revision page for empty revision (#7307)....
r4583 def test_empty_revision
Toshi MARUYAMA
Rails3: scm: subversion: fix error of test_empty_revision at functional test...
r7068 assert_equal 0, @repository.changesets.count
Toshi MARUYAMA
scm: subversion: change some functional tests project id from 1 to 3....
r4776 @repository.fetch_changesets
Toshi MARUYAMA
Rails3: scm: subversion: fix error of test_empty_revision at functional test...
r7068 @project.reload
assert_equal NUM_REV, @repository.changesets.count
Toshi MARUYAMA
scm: fix error on revision page for empty revision (#7307)....
r4583 ['', ' ', nil].each do |r|
Toshi MARUYAMA
scm: subversion: change some functional tests project id from 1 to 3....
r4776 get :revision, :id => PRJ_ID, :rev => r
Jean-Philippe Lang
Respond with 404 instead of 500 when revision/entry is not found in the repository (#7307)....
r4590 assert_response 404
Toshi MARUYAMA
scm: fix error on revision page for empty revision (#7307)....
r4583 assert_error_tag :content => /was not found/
end
end
Toshi MARUYAMA
scm: subversion: change some functional tests project id from 1 to 3....
r4776 # TODO: this test needs fixtures.
Jean-Philippe Lang
Fixed: View differences for individual file of a changeset fails if the subversion repository URL doesn't point to the repository root (#1209, #1262, #1275)....
r1432 def test_revision_with_repository_pointing_to_a_subdirectory
r = Project.find(1).repository
# Changes repository url to a subdirectory
r.update_attribute :url, (r.url + '/test/some')
Toshi MARUYAMA
scm: subversion: code clean up functional test....
r5441
Jean-Philippe Lang
Fixed: View differences for individual file of a changeset fails if the subversion repository URL doesn't point to the repository root (#1209, #1262, #1275)....
r1432 get :revision, :id => 1, :rev => 2
assert_response :success
assert_template 'revision'
Jean-Philippe Lang
Use assert_select instead of assert_tag....
r9925
assert_select 'ul' do
assert_select 'li' do
# link to the entry at rev 2
assert_select 'a[href=?]', '/projects/ecookbook/repository/revisions/2/entry/path/in/the/repo', :text => 'repo'
# link to partial diff
assert_select 'a[href=?]', '/projects/ecookbook/repository/revisions/2/diff/path/in/the/repo'
end
end
Jean-Philippe Lang
Fixed: View differences for individual file of a changeset fails if the subversion repository URL doesn't point to the repository root (#1209, #1262, #1275)....
r1432 end
Toshi MARUYAMA
scm: subversion: code clean up functional test....
r5441
Jean-Philippe Lang
SCM:...
r2744 def test_revision_diff
Toshi MARUYAMA
Rails3: scm: subversion: fix error of test_revision_diff at functional test...
r7069 assert_equal 0, @repository.changesets.count
Toshi MARUYAMA
scm: subversion: change some functional tests project id from 1 to 3....
r4776 @repository.fetch_changesets
Toshi MARUYAMA
Rails3: scm: subversion: fix error of test_revision_diff at functional test...
r7069 @project.reload
assert_equal NUM_REV, @repository.changesets.count
Toshi MARUYAMA
scm: subversion: run both of "inline" and "side by side" diff in functional test_revision_diff test....
r5861 ['inline', 'sbs'].each do |dt|
get :diff, :id => PRJ_ID, :rev => 3, :type => dt
assert_response :success
assert_template 'diff'
Jean-Philippe Lang
Remove trailing (revision nn) from filenames in subversion diffs....
r10242 assert_select 'h2', :text => /Revision 3/
assert_select 'th.filename', :text => 'subversion_test/textfile.txt'
Toshi MARUYAMA
scm: subversion: run both of "inline" and "side by side" diff in functional test_revision_diff test....
r5861 end
Jean-Philippe Lang
Added some functional tests (projects and repositories)....
r968 end
Jean-Philippe Lang
SCM:...
r2744
Jean-Philippe Lang
Adds a test for revision diff as raw format....
r7922 def test_revision_diff_raw_format
assert_equal 0, @repository.changesets.count
@repository.fetch_changesets
@project.reload
assert_equal NUM_REV, @repository.changesets.count
Toshi MARUYAMA
fix svn raw diff failure on svn version 1.6.17 (revision 1128011)...
r12149 get :diff, :id => PRJ_ID, :rev => 5, :format => 'diff'
Jean-Philippe Lang
Adds a test for revision diff as raw format....
r7922 assert_response :success
assert_equal 'text/x-patch', @response.content_type
Toshi MARUYAMA
fix svn raw diff failure on svn version 1.6.17 (revision 1128011)...
r12149 assert_equal 'Index: subversion_test/folder/greeter.rb', @response.body.split(/\r?\n/).first
Jean-Philippe Lang
Adds a test for revision diff as raw format....
r7922 end
Jean-Philippe Lang
SCM:...
r2744 def test_directory_diff
Toshi MARUYAMA
Rails3: scm: subversion: fix error of test_directory_diff at functional test...
r7070 assert_equal 0, @repository.changesets.count
Toshi MARUYAMA
scm: subversion: change some functional tests project id from 1 to 3....
r4776 @repository.fetch_changesets
Toshi MARUYAMA
Rails3: scm: subversion: fix error of test_directory_diff at functional test...
r7070 @project.reload
assert_equal NUM_REV, @repository.changesets.count
Toshi MARUYAMA
scm: subversion: run both of "inline" and "side by side" diff in functional test_directory_diff test....
r5862 ['inline', 'sbs'].each do |dt|
get :diff, :id => PRJ_ID, :rev => 6, :rev_to => 2,
Toshi MARUYAMA
Rails3: test: scm: subversion: use "repository_path_hash" for path param...
r8810 :path => repository_path_hash(['subversion_test', 'folder'])[:param],
:type => dt
Toshi MARUYAMA
scm: subversion: run both of "inline" and "side by side" diff in functional test_directory_diff test....
r5862 assert_response :success
assert_template 'diff'
Toshi MARUYAMA
scm: add compatible functional test fof changing diff revisions label at SCM adapter level....
r4545
Toshi MARUYAMA
scm: subversion: run both of "inline" and "side by side" diff in functional test_directory_diff test....
r5862 diff = assigns(:diff)
assert_not_nil diff
# 2 files modified
assert_equal 2, Redmine::UnifiedDiff.new(diff).size
assert_tag :tag => 'h2', :content => /2:6/
end
Jean-Philippe Lang
SCM:...
r2744 end
Toshi MARUYAMA
scm: subversion: code clean up functional test....
r5441
Jean-Philippe Lang
Added some functional tests (projects and repositories)....
r968 def test_annotate
Toshi MARUYAMA
Rails3: scm: subversion: fix error of test_annotate at functional test...
r7071 assert_equal 0, @repository.changesets.count
Toshi MARUYAMA
scm: subversion: change some functional tests project id from 1 to 3....
r4776 @repository.fetch_changesets
Toshi MARUYAMA
Rails3: scm: subversion: fix error of test_annotate at functional test...
r7071 @project.reload
assert_equal NUM_REV, @repository.changesets.count
Toshi MARUYAMA
Rails3: test: scm: subversion: use "repository_path_hash" for path param...
r8810 get :annotate, :id => PRJ_ID,
:path => repository_path_hash(['subversion_test', 'helloworld.c'])[:param]
Jean-Philippe Lang
Added some functional tests (projects and repositories)....
r968 assert_response :success
assert_template 'annotate'
Jean-Philippe Lang
Adds assertions for subversion annotate....
r9924
assert_select 'tr' do
assert_select 'th.line-num', :text => '1'
assert_select 'td.revision', :text => '4'
assert_select 'td.author', :text => 'jp'
assert_select 'td', :text => /stdio.h/
end
# Same revision
assert_select 'tr' do
assert_select 'th.line-num', :text => '2'
assert_select 'td.revision', :text => ''
assert_select 'td.author', :text => ''
end
Jean-Philippe Lang
Added some functional tests (projects and repositories)....
r968 end
Toshi MARUYAMA
scm: functional test of using format_revision() for annotate (#3724)....
r4614
def test_annotate_at_given_revision
Toshi MARUYAMA
Rails3: scm: subversion: fix error of test_annotate_at_given_revision at functional test...
r7072 assert_equal 0, @repository.changesets.count
Toshi MARUYAMA
scm: subversion: change some functional tests project id from 1 to 3....
r4776 @repository.fetch_changesets
Toshi MARUYAMA
Rails3: scm: subversion: fix error of test_annotate_at_given_revision at functional test...
r7072 @project.reload
assert_equal NUM_REV, @repository.changesets.count
Toshi MARUYAMA
Rails3: test: scm: subversion: use "repository_path_hash" for path param...
r8810 get :annotate, :id => PRJ_ID, :rev => 8,
:path => repository_path_hash(['subversion_test', 'helloworld.c'])[:param]
Toshi MARUYAMA
scm: functional test of using format_revision() for annotate (#3724)....
r4614 assert_response :success
assert_template 'annotate'
assert_tag :tag => 'h2', :content => /@ 8/
end
Toshi MARUYAMA
scm: subversion: add functional test of destroying valid repository (#8458, #6713, #4725)....
r6104
def test_destroy_valid_repository
@request.session[:user_id] = 1 # admin
Toshi MARUYAMA
Rails3: scm: subversion: fix error of test_destroy_valid_repository at functional test...
r7073 assert_equal 0, @repository.changesets.count
Toshi MARUYAMA
scm: subversion: add functional test of destroying valid repository (#8458, #6713, #4725)....
r6104 @repository.fetch_changesets
Toshi MARUYAMA
Rails3: scm: subversion: fix error of test_destroy_valid_repository at functional test...
r7073 assert_equal NUM_REV, @repository.changesets.count
Toshi MARUYAMA
scm: subversion: add functional test of destroying valid repository (#8458, #6713, #4725)....
r6104
Jean-Philippe Lang
Resourcified repositories for CRUD operations to prepare for multiple SCM per project (#779)....
r8528 assert_difference 'Repository.count', -1 do
delete :destroy, :id => @repository.id
end
Toshi MARUYAMA
scm: subversion: add functional test of destroying valid repository (#8458, #6713, #4725)....
r6104 assert_response 302
@project.reload
assert_nil @project.repository
end
Toshi MARUYAMA
scm: subversion: add functional test of destroying invalid repository (#8458, #6713, #4725)....
r6105 def test_destroy_invalid_repository
@request.session[:user_id] = 1 # admin
Jean-Philippe Lang
Resourcified repositories for CRUD operations to prepare for multiple SCM per project (#779)....
r8528 @project.repository.destroy
@repository = Repository::Subversion.create!(
Toshi MARUYAMA
scm: subversion: code clean up functional test....
r6111 :project => @project,
:url => "file:///invalid")
Toshi MARUYAMA
scm: subversion: add functional test of destroying invalid repository (#8458, #6713, #4725)....
r6105 @repository.fetch_changesets
assert_equal 0, @repository.changesets.count
Jean-Philippe Lang
Resourcified repositories for CRUD operations to prepare for multiple SCM per project (#779)....
r8528 assert_difference 'Repository.count', -1 do
delete :destroy, :id => @repository.id
end
Toshi MARUYAMA
scm: subversion: add functional test of destroying invalid repository (#8458, #6713, #4725)....
r6105 assert_response 302
@project.reload
assert_nil @project.repository
end
Jean-Philippe Lang
Added some functional tests (projects and repositories)....
r968 else
puts "Subversion test repository NOT FOUND. Skipping functional tests !!!"
def test_fake; assert true end
end
end