##// END OF EJS Templates
Replace Date.today with User.current.today (#22320)....
Replace Date.today with User.current.today (#22320). Depending on the offset between a user's configured timezone and the server timezone, Date.today may be more or less often wrong from the user's perspective, leading to things like issues marked as overdue too early or too late, or yesterday / tomorrow being displayed / selected where 'today' is intended. A test case illustrating the problem with Issue#overdue? is included Patch by Jens Kraemer. git-svn-id: http://svn.redmine.org/redmine/trunk@15379 e93f8b46-1217-0410-a6f0-8f06a7374b81

File last commit:

r14946:dae1e6ab2179
r14997:ed50d42210ea
Show More
repositories_subversion_controller_test.rb
421 lines | 15.0 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
Updates copyright for 2016....
r14856 # Copyright (C) 2006-2016 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
Add support for multiple email addresses per user (#4244)....
r13504 fixtures :projects, :users, :email_addresses, :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
Quote values in DOM selectors for Nokogiri compatibility....
r13237 assert_select 'tr.dir a[href="/projects/subproject1/repository/show/subversion_test"]'
Jean-Philippe Lang
Removed duplicated test....
r8546
Jean-Philippe Lang
Replaced remaining #assert_tag with #assert_select....
r13242 assert_select 'input[name=rev]'
assert_select 'a', :text => 'Statistics'
assert_select 'a', :text => 'Atom'
assert_select 'a[href=?]', '/projects/subproject1/repository', :text => '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'
Jean-Philippe Lang
Quote values in DOM selectors for Nokogiri compatibility....
r13237 assert_select 'tr.dir a[href="/projects/subproject1/repository/svn/show/subversion_test"]'
Jean-Philippe Lang
Merged rails-3.2 branch....
r9346 # Repository menu should link to the main repo
Jean-Philippe Lang
Quote values in DOM selectors for Nokogiri compatibility....
r13237 assert_select '#main-menu a[href="/projects/subproject1/repository"]'
Jean-Philippe Lang
Merged rails-3.2 branch....
r9346 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
Replaced remaining #assert_tag with #assert_select....
r13242 assert_select 'a.text-x-c', :text => 'helloworld.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']
Jean-Philippe Lang
Replaced remaining #assert_tag with #assert_select....
r13242 assert_select 'ul li' do
assert_select 'b', :text => 'svn:eol-style'
assert_select 'span', :text => 'native'
end
Jean-Philippe Lang
Fixes a test failure with svn < 1.5 (#2455)....
r2247 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
Fix test failures (#22058)....
r14946 def test_entry_should_display_images
Jean-Philippe Lang
Show repository images inline when clicking 'View' (#10362)....
r9593 get :entry, :id => PRJ_ID,
:path => repository_path_hash(['subversion_test', 'folder', 'subfolder', 'rubylogo.gif'])[:param]
assert_response :success
Jean-Philippe Lang
Fix test failures (#22058)....
r14946 assert_template 'entry'
Jean-Philippe Lang
Show repository images inline when clicking 'View' (#10362)....
r9593 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
Jean-Philippe Lang
Replaced remaining #assert_tag with #assert_select....
r13242 assert_select 'td.line-code', :text => /Here's the code/
Jean-Philippe Lang
Fixed: view file at given revision with CVS....
r1539 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]
Jean-Philippe Lang
Replaced remaining #assert_tag with #assert_select....
r13242 assert_select 'p#errorExplanation', :text => /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
Replaced remaining #assert_tag with #assert_select....
r13242 assert_select_error /was not found/
Jean-Philippe Lang
Restore rev param validation that was removed in r2840....
r4428 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
Jean-Philippe Lang
Replaced remaining #assert_tag with #assert_select....
r13242 assert_select_error /was not found/
Toshi MARUYAMA
scm: fix diff revision param validation....
r4740 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
Jean-Philippe Lang
Replaced remaining #assert_tag with #assert_select....
r13242 assert_select_error /was not found/
Toshi MARUYAMA
scm: fix error on revision page for empty revision (#7307)....
r4583 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
Jean-Philippe Lang
Replaced remaining #assert_tag with #assert_select....
r13242 assert_select 'h2', :text => /2:6/
Toshi MARUYAMA
scm: subversion: run both of "inline" and "side by side" diff in functional test_directory_diff test....
r5862 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'
Jean-Philippe Lang
Replaced remaining #assert_tag with #assert_select....
r13242 assert_select 'h2', :text => /@ 8/
Toshi MARUYAMA
scm: functional test of using format_revision() for annotate (#3724)....
r4614 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