summaryrefslogtreecommitdiffstats
path: root/test/functional/wiki_controller_test.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2012-06-26 16:57:09 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2012-06-26 16:57:09 +0000
commit6529035ee128c9b995a7a85d347f20ed1412f3ab (patch)
tree733c327486b8187c5927030eae9d157c519e8e68 /test/functional/wiki_controller_test.rb
parent7f6ac407ef11b94a3e99e4a712320f3a6faa22ec (diff)
downloadredmine-6529035ee128c9b995a7a85d347f20ed1412f3ab.tar.gz
redmine-6529035ee128c9b995a7a85d347f20ed1412f3ab.zip
Fixed that wiki diff may produce html (#11209).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@9895 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/functional/wiki_controller_test.rb')
-rw-r--r--test/functional/wiki_controller_test.rb14
1 files changed, 11 insertions, 3 deletions
diff --git a/test/functional/wiki_controller_test.rb b/test/functional/wiki_controller_test.rb
index b87a26aee..f4e82d7d0 100644
--- a/test/functional/wiki_controller_test.rb
+++ b/test/functional/wiki_controller_test.rb
@@ -495,11 +495,19 @@ class WikiControllerTest < ActionController::TestCase
end
def test_diff
- get :diff, :project_id => 1, :id => 'CookBook_documentation', :version => 2, :version_from => 1
+ content = WikiPage.find(1).content
+ assert_difference 'WikiContent::Version.count', 2 do
+ content.text = "Line removed\nThis is a sample text for testing diffs"
+ content.save!
+ content.text = "This is a sample text for testing diffs\nLine added"
+ content.save!
+ end
+
+ get :diff, :project_id => 1, :id => 'CookBook_documentation', :version => content.version, :version_from => (content.version - 1)
assert_response :success
assert_template 'diff'
- assert_tag :tag => 'span', :attributes => { :class => 'diff_in'},
- :content => /updated/
+ assert_select 'span.diff_out', :text => 'Line removed'
+ assert_select 'span.diff_in', :text => 'Line added'
end
def test_annotate