##// END OF EJS Templates
When copying issues, let the status be changed to default or left unchanged....
When copying issues, let the status be changed to default or left unchanged. git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@9404 e93f8b46-1217-0410-a6f0-8f06a7374b81

File last commit:

r8888:4f153083ac00
r9270:09375960d69d
Show More
repositories_subversion_controller_test.rb
395 lines | 14.7 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
# Copyright (C) 2006-2011 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
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'
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
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
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
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],
:format => 'raw'
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
Render the commit changes list as a tree (#1896)....
r1868 assert_tag :tag => 'ul',
:child => { :tag => 'li',
Jean-Philippe Lang
Makes changes link to entries on the revision view....
r1538 # link to the entry at rev 2
Toshi MARUYAMA
scm: subversion: remove trailing white-spaces from functional test....
r5581 :child => { :tag => 'a',
Eric Davis
Converted routing and urls to follow the Rails REST convention....
r2315 :attributes => {:href => '/projects/ecookbook/repository/revisions/2/entry/test/some/path/in/the/repo'},
Jean-Philippe Lang
Render the commit changes list as a tree (#1896)....
r1868 :content => 'repo',
# link to partial diff
Toshi MARUYAMA
scm: subversion: remove trailing white-spaces from functional test....
r5581 :sibling => { :tag => 'a',
:attributes => { :href => '/projects/ecookbook/repository/revisions/2/diff/test/some/path/in/the/repo' }
Jean-Philippe Lang
Render the commit changes list as a tree (#1896)....
r1868 }
}
}
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
Render the commit changes list as a tree (#1896)....
r1868 assert_tag :tag => 'ul',
:child => { :tag => 'li',
# link to the entry at rev 2
Toshi MARUYAMA
scm: subversion: remove trailing white-spaces from functional test....
r5581 :child => { :tag => 'a',
Eric Davis
Converted routing and urls to follow the Rails REST convention....
r2315 :attributes => {:href => '/projects/ecookbook/repository/revisions/2/entry/path/in/the/repo'},
Jean-Philippe Lang
Render the commit changes list as a tree (#1896)....
r1868 :content => 'repo',
# link to partial diff
Toshi MARUYAMA
scm: subversion: remove trailing white-spaces from functional test....
r5581 :sibling => { :tag => 'a',
:attributes => { :href => '/projects/ecookbook/repository/revisions/2/diff/path/in/the/repo' }
Jean-Philippe Lang
Render the commit changes list as a tree (#1896)....
r1868 }
}
}
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'
assert_tag :tag => 'h2',
:content => / 3/
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
get :diff, :id => PRJ_ID, :rev => 3, :format => 'diff'
assert_response :success
assert_equal 'text/x-patch', @response.content_type
assert_equal 'Index: subversion_test/textfile.txt', @response.body.split(/\r?\n/).first
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'
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