@@ -212,6 +212,10 class WikiAnnotate | |||
|
212 | 212 | break unless @lines.detect { |line| line[0].nil? } |
|
213 | 213 | current = current.previous |
|
214 | 214 | end |
|
215 |
@lines.each { |line| |
|
|
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 | 220 | end |
|
217 | 221 | end |
@@ -250,14 +250,24 class WikiControllerTest < ActionController::TestCase | |||
|
250 | 250 | get :annotate, :project_id => 1, :id => 'CookBook_documentation', :version => 2 |
|
251 | 251 | assert_response :success |
|
252 | 252 | assert_template 'annotate' |
|
253 | ||
|
253 | 254 | # Line 1 |
|
254 | assert_tag :tag => 'tr', :child => { :tag => 'th', :attributes => {:class => 'line-num'}, :content => '1' }, | |
|
255 |
|
|
|
256 | :child => { :tag => 'td', :content => /h1\. CookBook documentation/ } | |
|
257 | # Line 2 | |
|
258 | assert_tag :tag => 'tr', :child => { :tag => 'th', :attributes => {:class => 'line-num'}, :content => '2' }, | |
|
259 | :child => { :tag => 'td', :attributes => {:class => 'author'}, :content => /redMine Admin/ }, | |
|
260 | :child => { :tag => 'td', :content => /Some updated \[\[documentation\]\] here/ } | |
|
255 | assert_tag :tag => 'tr', :child => { | |
|
256 | :tag => 'th', :attributes => {:class => 'line-num'}, :content => '1', :sibling => { | |
|
257 | :tag => 'td', :attributes => {:class => 'author'}, :content => /John Smith/, :sibling => { | |
|
258 | :tag => 'td', :content => /h1\. CookBook documentation/ | |
|
259 | } | |
|
260 | } | |
|
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 | 271 | end |
|
262 | 272 | |
|
263 | 273 | def test_get_rename |
General Comments 0
You need to be logged in to leave comments.
Login now