Fixed: Wiki annotated page does not display author of version 1 (#8449).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@6206 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
3c2ebd7aa2
commit
b0728550a3
|
@ -212,6 +212,10 @@ class WikiAnnotate
|
||||||
break unless @lines.detect { |line| line[0].nil? }
|
break unless @lines.detect { |line| line[0].nil? }
|
||||||
current = current.previous
|
current = current.previous
|
||||||
end
|
end
|
||||||
@lines.each { |line| line[0] ||= current.version }
|
@lines.each { |line|
|
||||||
|
line[0] ||= current.version
|
||||||
|
# if the last known version is > 1 (eg. history was cleared), we don't know the author
|
||||||
|
line[1] ||= current.author if current.version == 1
|
||||||
|
}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -250,14 +250,24 @@ class WikiControllerTest < ActionController::TestCase
|
||||||
get :annotate, :project_id => 1, :id => 'CookBook_documentation', :version => 2
|
get :annotate, :project_id => 1, :id => 'CookBook_documentation', :version => 2
|
||||||
assert_response :success
|
assert_response :success
|
||||||
assert_template 'annotate'
|
assert_template 'annotate'
|
||||||
|
|
||||||
# Line 1
|
# Line 1
|
||||||
assert_tag :tag => 'tr', :child => { :tag => 'th', :attributes => {:class => 'line-num'}, :content => '1' },
|
assert_tag :tag => 'tr', :child => {
|
||||||
:child => { :tag => 'td', :attributes => {:class => 'author'}, :content => /John Smith/ },
|
:tag => 'th', :attributes => {:class => 'line-num'}, :content => '1', :sibling => {
|
||||||
:child => { :tag => 'td', :content => /h1\. CookBook documentation/ }
|
:tag => 'td', :attributes => {:class => 'author'}, :content => /John Smith/, :sibling => {
|
||||||
# Line 2
|
:tag => 'td', :content => /h1\. CookBook documentation/
|
||||||
assert_tag :tag => 'tr', :child => { :tag => 'th', :attributes => {:class => 'line-num'}, :content => '2' },
|
}
|
||||||
:child => { :tag => 'td', :attributes => {:class => 'author'}, :content => /redMine Admin/ },
|
}
|
||||||
:child => { :tag => 'td', :content => /Some updated \[\[documentation\]\] here/ }
|
}
|
||||||
|
|
||||||
|
# Line 5
|
||||||
|
assert_tag :tag => 'tr', :child => {
|
||||||
|
:tag => 'th', :attributes => {:class => 'line-num'}, :content => '5', :sibling => {
|
||||||
|
:tag => 'td', :attributes => {:class => 'author'}, :content => /redMine Admin/, :sibling => {
|
||||||
|
:tag => 'td', :content => /Some updated \[\[documentation\]\] here/
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_get_rename
|
def test_get_rename
|
||||||
|
|
Loading…
Reference in New Issue