Merged r9895 from trunk.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/2.0-stable@9956 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang
2012-07-08 12:34:09 +00:00
parent 3cc0730f54
commit 6488210ec1
2 changed files with 16 additions and 7 deletions

View File

@@ -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