comparison test/functional/.svn/text-base/repositories_mercurial_controller_test.rb.svn-base @ 246:eeebe205a056 cannam

* Merge from default branch, bringing us up to SVN trunk rev 4993
author Chris Cannam
date Thu, 03 Mar 2011 12:02:03 +0000
parents 5e974759e8b2 051f544170fe
children 753f1380d6bc
comparison
equal deleted inserted replaced
138:fca2657f4aa5 246:eeebe205a056
32 @request = ActionController::TestRequest.new 32 @request = ActionController::TestRequest.new
33 @response = ActionController::TestResponse.new 33 @response = ActionController::TestResponse.new
34 User.current = nil 34 User.current = nil
35 @repository = Repository::Mercurial.create(:project => Project.find(3), :url => REPOSITORY_PATH) 35 @repository = Repository::Mercurial.create(:project => Project.find(3), :url => REPOSITORY_PATH)
36 assert @repository 36 assert @repository
37 @diff_c_support = true
37 end 38 end
38 39
39 if File.directory?(REPOSITORY_PATH) 40 if File.directory?(REPOSITORY_PATH)
40 def test_show 41 def test_show
41 get :show, :id => 3 42 get :show, :id => 3
135 # Full diff of changeset 4 136 # Full diff of changeset 4
136 get :diff, :id => 3, :rev => r1 137 get :diff, :id => 3, :rev => r1
137 assert_response :success 138 assert_response :success
138 assert_template 'diff' 139 assert_template 'diff'
139 140
140 if @repository.scm.class.client_version_above?([1, 2]) 141 if @diff_c_support
141 # Line 22 removed 142 # Line 22 removed
142 assert_tag :tag => 'th', 143 assert_tag :tag => 'th',
143 :content => '22', 144 :content => '22',
144 :sibling => { :tag => 'td', 145 :sibling => { :tag => 'td',
145 :attributes => { :class => /diff_out/ }, 146 :attributes => { :class => /diff_out/ },
194 :content => '23', 195 :content => '23',
195 :attributes => { :class => 'line-num' }, 196 :attributes => { :class => 'line-num' },
196 :sibling => { :tag => 'td', :content => /watcher =/ } 197 :sibling => { :tag => 'td', :content => /watcher =/ }
197 end 198 end
198 199
200 def test_annotate_at_given_revision
201 @repository.fetch_changesets
202 @repository.reload
203 [2, '400bb8672109', '400', 400].each do |r1|
204 get :annotate, :id => 3, :rev => r1, :path => ['sources', 'watchers_controller.rb']
205 assert_response :success
206 assert_template 'annotate'
207 assert_tag :tag => 'h2', :content => /@ 2:400bb8672109/
208 end
209 end
210
199 def test_empty_revision 211 def test_empty_revision
200 @repository.fetch_changesets 212 @repository.fetch_changesets
201 @repository.reload 213 @repository.reload
202 ['', ' ', nil].each do |r| 214 ['', ' ', nil].each do |r|
203 get :revision, :id => 3, :rev => r 215 get :revision, :id => 3, :rev => r