@@ -19,25 +19,26 require File.expand_path('../../test_helper', __FILE__) | |||||
19 |
|
19 | |||
20 | class RepositoryFilesystemTest < ActiveSupport::TestCase |
|
20 | class RepositoryFilesystemTest < ActiveSupport::TestCase | |
21 | fixtures :projects |
|
21 | fixtures :projects | |
22 |
|
22 | |||
23 | # No '..' in the repository path |
|
23 | # No '..' in the repository path | |
24 | REPOSITORY_PATH = RAILS_ROOT.gsub(%r{config\/\.\.}, '') + '/tmp/test/filesystem_repository' |
|
24 | REPOSITORY_PATH = RAILS_ROOT.gsub(%r{config\/\.\.}, '') + '/tmp/test/filesystem_repository' | |
25 |
|
25 | |||
26 | def setup |
|
26 | def setup | |
27 | @project = Project.find(1) |
|
27 | @project = Project.find(1) | |
28 | Setting.enabled_scm << 'Filesystem' unless Setting.enabled_scm.include?('Filesystem') |
|
28 | Setting.enabled_scm << 'Filesystem' unless Setting.enabled_scm.include?('Filesystem') | |
29 |
assert @repository = Repository::Filesystem.create( |
|
29 | assert @repository = Repository::Filesystem.create( | |
|
30 | :project => @project, :url => REPOSITORY_PATH) | |||
30 | end |
|
31 | end | |
31 |
|
32 | |||
32 | if File.directory?(REPOSITORY_PATH) |
|
33 | if File.directory?(REPOSITORY_PATH) | |
33 | def test_fetch_changesets |
|
34 | def test_fetch_changesets | |
34 | @repository.fetch_changesets |
|
35 | @repository.fetch_changesets | |
35 | @repository.reload |
|
36 | @repository.reload | |
36 |
|
37 | |||
37 | assert_equal 0, @repository.changesets.count |
|
38 | assert_equal 0, @repository.changesets.count | |
38 | assert_equal 0, @repository.changes.count |
|
39 | assert_equal 0, @repository.changes.count | |
39 | end |
|
40 | end | |
40 |
|
41 | |||
41 | def test_entries |
|
42 | def test_entries | |
42 | assert_equal 2, @repository.entries("", 2).size |
|
43 | assert_equal 2, @repository.entries("", 2).size | |
43 | assert_equal 2, @repository.entries("dir", 3).size |
|
44 | assert_equal 2, @repository.entries("dir", 3).size |
General Comments 0
You need to be logged in to leave comments.
Login now