##// END OF EJS Templates
scm: mercurial: check changesets size is greater than 0 in browse test in functional test....
Toshi MARUYAMA -
r5002:a5e55a90536b
parent child
Show More
@@ -69,6 +69,8 class RepositoriesMercurialControllerTest < ActionController::TestCase
69 69 end
70 70
71 71 def test_show_root
72 @repository.fetch_changesets
73 @repository.reload
72 74 get :show, :id => 3
73 75 assert_response :success
74 76 assert_template 'show'
@@ -77,9 +79,13 class RepositoriesMercurialControllerTest < ActionController::TestCase
77 79 assert assigns(:entries).detect {|e| e.name == 'images' && e.kind == 'dir'}
78 80 assert assigns(:entries).detect {|e| e.name == 'sources' && e.kind == 'dir'}
79 81 assert assigns(:entries).detect {|e| e.name == 'README' && e.kind == 'file'}
82 assert_not_nil assigns(:changesets)
83 assigns(:changesets).size > 0
80 84 end
81 85
82 86 def test_show_directory
87 @repository.fetch_changesets
88 @repository.reload
83 89 get :show, :id => 3, :path => ['images']
84 90 assert_response :success
85 91 assert_template 'show'
@@ -89,19 +95,27 class RepositoriesMercurialControllerTest < ActionController::TestCase
89 95 assert_not_nil entry
90 96 assert_equal 'file', entry.kind
91 97 assert_equal 'images/edit.png', entry.path
98 assert_not_nil assigns(:changesets)
99 assigns(:changesets).size > 0
92 100 end
93 101
94 102 def test_show_at_given_revision
103 @repository.fetch_changesets
104 @repository.reload
95 105 [0, '0', '0885933ad4f6'].each do |r1|
96 106 get :show, :id => 3, :path => ['images'], :rev => r1
97 107 assert_response :success
98 108 assert_template 'show'
99 109 assert_not_nil assigns(:entries)
100 110 assert_equal ['delete.png'], assigns(:entries).collect(&:name)
111 assert_not_nil assigns(:changesets)
112 assigns(:changesets).size > 0
101 113 end
102 114 end
103 115
104 116 def test_show_directory_sql_escape_percent
117 @repository.fetch_changesets
118 @repository.reload
105 119 [13, '13', '3a330eb32958'].each do |r1|
106 120 get :show, :id => 3, :path => ['sql_escape', 'percent%dir'], :rev => r1
107 121 assert_response :success
@@ -110,6 +124,7 class RepositoriesMercurialControllerTest < ActionController::TestCase
110 124 assert_not_nil assigns(:entries)
111 125 assert_equal ['percent%file1.txt', 'percentfile1.txt'], assigns(:entries).collect(&:name)
112 126 changesets = assigns(:changesets)
127 assigns(:changesets).size > 0
113 128
114 129 ## This is not yet implemented.
115 130 # assert_not_nil changesets
General Comments 0
You need to be logged in to leave comments. Login now