Project

General

Profile

Defect #11209 ยป 0001-Fix-too-escaped-span-in-diff-page-for-Wiki-11209.patch

Kouhei Sutou, 2012-06-20 17:30

View differences:

lib/redmine/helpers/diff.rb
56 56
          end
57 57
          if add_at
58 58
            words[add_at] = '<span class="diff_in">' + words[add_at]
59
            words[add_to] = words[add_to] + '</span>'
59
            words[add_to] = words[add_to] + '</span>'.html_safe
60 60
          end
61 61
          if del_at
62 62
            words.insert del_at - del_off + dels + words_add, '<span class="diff_out">' + deleted + '</span>'
test/fixtures/wiki_content_versions.yml
42 42
    h1. CookBook documentation
43 43
    Some updated [[documentation]] here...
44 44
wiki_content_versions_004: 
45
  updated_on: 2007-03-08 00:10:51 +01:00
46
  page_id: 1
47
  id: 4
48
  version: 4
49
  author_id: 1
50
  comments: ""
51
  wiki_content_id: 1
52
  compression: ""
53
  data: |-
54
    h1. CookBook documentation
55
    Some updated [[documentation]] here...
56
    More contents...
57
wiki_content_versions_005: 
45 58
  data: |-
46 59
    h1. Another page
47 60
    
......
49 62
  updated_on: 2007-03-08 00:18:07 +01:00
50 63
  page_id: 2
51 64
  wiki_content_id: 2
52
  id: 4
65
  id: 5
53 66
  version: 1
54 67
  author_id: 1
55 68
  comments: 
56
wiki_content_versions_005: 
69
wiki_content_versions_006: 
57 70
  data: |-
58 71
    h1. Title
59 72
    
......
73 86
  updated_on: 2007-03-08 00:16:07 +01:00
74 87
  page_id: 11
75 88
  wiki_content_id: 11
76
  id: 5
89
  id: 6
77 90
  version: 2
78 91
  author_id: 1
79 92
  comments: 
80
wiki_content_versions_006: 
93
wiki_content_versions_007: 
81 94
  data: |-
82 95
    h1. Title
83 96
    
......
95 108
  updated_on: 2007-03-08 00:18:07 +01:00
96 109
  page_id: 11
97 110
  wiki_content_id: 11
98
  id: 6
111
  id: 7
99 112
  version: 3
100 113
  author_id: 1
101 114
  comments: 
test/functional/wiki_controller_test.rb
481 481
    assert_response :success
482 482
    assert_template 'history'
483 483
    assert_not_nil assigns(:versions)
484
    assert_equal 3, assigns(:versions).size
484
    assert_equal 4, assigns(:versions).size
485 485
    assert_select "input[type=submit][name=commit]"
486 486
  end
487 487

  
......
494 494
    assert_select "input[type=submit][name=commit]", false
495 495
  end
496 496

  
497
  def test_diff
497
  def test_diff_change
498 498
    get :diff, :project_id => 1, :id => 'CookBook_documentation', :version => 2, :version_from => 1
499 499
    assert_response :success
500 500
    assert_template 'diff'
......
502 502
                               :content => /updated/
503 503
  end
504 504

  
505
  def test_diff_add
506
    get :diff, :project_id => 1, :id => 'CookBook_documentation', :version => 4, :version_from => 3
507
    assert_response :success
508
    assert_template 'diff'
509
    puts @response.body
510
    assert_tag :tag => 'span', :attributes => {:class => 'diff_in'},
511
                               :content => " More contents..."
512

  
513
  end
514

  
505 515
  def test_annotate
506 516
    get :annotate, :project_id => 1, :id =>  'CookBook_documentation', :version => 2
507 517
    assert_response :success
    (1-1/1)