##// END OF EJS Templates
Fixed: Wiki annotated page does not display author of version 1 (#8449)....
Jean-Philippe Lang -
r6086:b0728550a35c
parent child
Show More
@@ -212,6 +212,10 class WikiAnnotate
212 break unless @lines.detect { |line| line[0].nil? }
212 break unless @lines.detect { |line| line[0].nil? }
213 current = current.previous
213 current = current.previous
214 end
214 end
215 @lines.each { |line| line[0] ||= current.version }
215 @lines.each { |line|
216 line[0] ||= current.version
217 # if the last known version is > 1 (eg. history was cleared), we don't know the author
218 line[1] ||= current.author if current.version == 1
219 }
216 end
220 end
217 end
221 end
@@ -250,14 +250,24 class WikiControllerTest < ActionController::TestCase
250 get :annotate, :project_id => 1, :id => 'CookBook_documentation', :version => 2
250 get :annotate, :project_id => 1, :id => 'CookBook_documentation', :version => 2
251 assert_response :success
251 assert_response :success
252 assert_template 'annotate'
252 assert_template 'annotate'
253
253 # Line 1
254 # Line 1
254 assert_tag :tag => 'tr', :child => { :tag => 'th', :attributes => {:class => 'line-num'}, :content => '1' },
255 assert_tag :tag => 'tr', :child => {
255 :child => { :tag => 'td', :attributes => {:class => 'author'}, :content => /John Smith/ },
256 :tag => 'th', :attributes => {:class => 'line-num'}, :content => '1', :sibling => {
256 :child => { :tag => 'td', :content => /h1\. CookBook documentation/ }
257 :tag => 'td', :attributes => {:class => 'author'}, :content => /John Smith/, :sibling => {
257 # Line 2
258 :tag => 'td', :content => /h1\. CookBook documentation/
258 assert_tag :tag => 'tr', :child => { :tag => 'th', :attributes => {:class => 'line-num'}, :content => '2' },
259 }
259 :child => { :tag => 'td', :attributes => {:class => 'author'}, :content => /redMine Admin/ },
260 }
260 :child => { :tag => 'td', :content => /Some updated \[\[documentation\]\] here/ }
261 }
262
263 # Line 5
264 assert_tag :tag => 'tr', :child => {
265 :tag => 'th', :attributes => {:class => 'line-num'}, :content => '5', :sibling => {
266 :tag => 'td', :attributes => {:class => 'author'}, :content => /redMine Admin/, :sibling => {
267 :tag => 'td', :content => /Some updated \[\[documentation\]\] here/
268 }
269 }
270 }
261 end
271 end
262
272
263 def test_get_rename
273 def test_get_rename
General Comments 0
You need to be logged in to leave comments. Login now