Defect #11209 ยป 0001-Fix-too-escaped-span-in-diff-page-for-Wiki-11209.patch
| lib/redmine/helpers/diff.rb | ||
|---|---|---|
|
end
|
||
|
if add_at
|
||
|
words[add_at] = '<span class="diff_in">' + words[add_at]
|
||
|
words[add_to] = words[add_to] + '</span>'
|
||
|
words[add_to] = words[add_to] + '</span>'.html_safe
|
||
|
end
|
||
|
if del_at
|
||
|
words.insert del_at - del_off + dels + words_add, '<span class="diff_out">' + deleted + '</span>'
|
||
| test/fixtures/wiki_content_versions.yml | ||
|---|---|---|
|
h1. CookBook documentation
|
||
|
Some updated [[documentation]] here...
|
||
|
wiki_content_versions_004:
|
||
|
updated_on: 2007-03-08 00:10:51 +01:00
|
||
|
page_id: 1
|
||
|
id: 4
|
||
|
version: 4
|
||
|
author_id: 1
|
||
|
comments: ""
|
||
|
wiki_content_id: 1
|
||
|
compression: ""
|
||
|
data: |-
|
||
|
h1. CookBook documentation
|
||
|
Some updated [[documentation]] here...
|
||
|
More contents...
|
||
|
wiki_content_versions_005:
|
||
|
data: |-
|
||
|
h1. Another page
|
||
|
|
||
| ... | ... | |
|
updated_on: 2007-03-08 00:18:07 +01:00
|
||
|
page_id: 2
|
||
|
wiki_content_id: 2
|
||
|
id: 4
|
||
|
id: 5
|
||
|
version: 1
|
||
|
author_id: 1
|
||
|
comments:
|
||
|
wiki_content_versions_005:
|
||
|
wiki_content_versions_006:
|
||
|
data: |-
|
||
|
h1. Title
|
||
|
|
||
| ... | ... | |
|
updated_on: 2007-03-08 00:16:07 +01:00
|
||
|
page_id: 11
|
||
|
wiki_content_id: 11
|
||
|
id: 5
|
||
|
id: 6
|
||
|
version: 2
|
||
|
author_id: 1
|
||
|
comments:
|
||
|
wiki_content_versions_006:
|
||
|
wiki_content_versions_007:
|
||
|
data: |-
|
||
|
h1. Title
|
||
|
|
||
| ... | ... | |
|
updated_on: 2007-03-08 00:18:07 +01:00
|
||
|
page_id: 11
|
||
|
wiki_content_id: 11
|
||
|
id: 6
|
||
|
id: 7
|
||
|
version: 3
|
||
|
author_id: 1
|
||
|
comments:
|
||
| test/functional/wiki_controller_test.rb | ||
|---|---|---|
|
assert_response :success
|
||
|
assert_template 'history'
|
||
|
assert_not_nil assigns(:versions)
|
||
|
assert_equal 3, assigns(:versions).size
|
||
|
assert_equal 4, assigns(:versions).size
|
||
|
assert_select "input[type=submit][name=commit]"
|
||
|
end
|
||
| ... | ... | |
|
assert_select "input[type=submit][name=commit]", false
|
||
|
end
|
||
|
def test_diff
|
||
|
def test_diff_change
|
||
|
get :diff, :project_id => 1, :id => 'CookBook_documentation', :version => 2, :version_from => 1
|
||
|
assert_response :success
|
||
|
assert_template 'diff'
|
||
| ... | ... | |
|
:content => /updated/
|
||
|
end
|
||
|
def test_diff_add
|
||
|
get :diff, :project_id => 1, :id => 'CookBook_documentation', :version => 4, :version_from => 3
|
||
|
assert_response :success
|
||
|
assert_template 'diff'
|
||
|
puts @response.body
|
||
|
assert_tag :tag => 'span', :attributes => {:class => 'diff_in'},
|
||
|
:content => " More contents..."
|
||
|
end
|
||
|
def test_annotate
|
||
|
get :annotate, :project_id => 1, :id => 'CookBook_documentation', :version => 2
|
||
|
assert_response :success
|
||