##// END OF EJS Templates
Extend changes.path and changes.from_path to support longer paths. #5771...
Eric Davis -
r3714:56af944afa14
parent child
Show More
@@ -0,0 +1,11
1 class ChangeChangesPathLengthLimit < ActiveRecord::Migration
2 def self.up
3 change_column :changes, :path, :text, :default => "", :null => false
4 change_column :changes, :from_path, :text
5 end
6
7 def self.down
8 change_column :changes, :path, :string, :default => "", :null => false
9 change_column :changes, :from_path, :string
10 end
11 end
1 NO CONTENT: modified file, binary diff hidden
NO CONTENT: modified file, binary diff hidden
@@ -50,8 +50,9 class RepositoriesGitControllerTest < ActionController::TestCase
50 assert_response :success
50 assert_response :success
51 assert_template 'show'
51 assert_template 'show'
52 assert_not_nil assigns(:entries)
52 assert_not_nil assigns(:entries)
53 assert_equal 6, assigns(:entries).size
53 assert_equal 7, assigns(:entries).size
54 assert assigns(:entries).detect {|e| e.name == 'images' && e.kind == 'dir'}
54 assert assigns(:entries).detect {|e| e.name == 'images' && e.kind == 'dir'}
55 assert assigns(:entries).detect {|e| e.name == 'this_is_a_really_long_and_verbose_directory_name' && e.kind == 'dir'}
55 assert assigns(:entries).detect {|e| e.name == 'sources' && e.kind == 'dir'}
56 assert assigns(:entries).detect {|e| e.name == 'sources' && e.kind == 'dir'}
56 assert assigns(:entries).detect {|e| e.name == 'README' && e.kind == 'file'}
57 assert assigns(:entries).detect {|e| e.name == 'README' && e.kind == 'file'}
57 assert assigns(:entries).detect {|e| e.name == 'copied_README' && e.kind == 'file'}
58 assert assigns(:entries).detect {|e| e.name == 'copied_README' && e.kind == 'file'}
@@ -13,7 +13,7 class GitAdapterTest < ActiveSupport::TestCase
13 end
13 end
14
14
15 def test_getting_all_revisions
15 def test_getting_all_revisions
16 assert_equal 12, @adapter.revisions('',nil,nil,:all => true).length
16 assert_equal 13, @adapter.revisions('',nil,nil,:all => true).length
17 end
17 end
18
18
19 def test_annotate
19 def test_annotate
@@ -34,8 +34,8 class RepositoryGitTest < ActiveSupport::TestCase
34 @repository.fetch_changesets
34 @repository.fetch_changesets
35 @repository.reload
35 @repository.reload
36
36
37 assert_equal 12, @repository.changesets.count
37 assert_equal 13, @repository.changesets.count
38 assert_equal 21, @repository.changes.count
38 assert_equal 22, @repository.changes.count
39
39
40 commit = @repository.changesets.find(:first, :order => 'committed_on ASC')
40 commit = @repository.changesets.find(:first, :order => 'committed_on ASC')
41 assert_equal "Initial import.\nThe repository contains 3 files.", commit.comments
41 assert_equal "Initial import.\nThe repository contains 3 files.", commit.comments
@@ -57,10 +57,10 class RepositoryGitTest < ActiveSupport::TestCase
57 # Remove the 3 latest changesets
57 # Remove the 3 latest changesets
58 @repository.changesets.find(:all, :order => 'committed_on DESC', :limit => 3).each(&:destroy)
58 @repository.changesets.find(:all, :order => 'committed_on DESC', :limit => 3).each(&:destroy)
59 @repository.reload
59 @repository.reload
60 assert_equal 9, @repository.changesets.count
60 assert_equal 10, @repository.changesets.count
61
61
62 @repository.fetch_changesets
62 @repository.fetch_changesets
63 assert_equal 12, @repository.changesets.count
63 assert_equal 13, @repository.changesets.count
64 end
64 end
65 else
65 else
66 puts "Git test repository NOT FOUND. Skipping unit tests !!!"
66 puts "Git test repository NOT FOUND. Skipping unit tests !!!"
General Comments 0
You need to be logged in to leave comments. Login now