mirror of
https://github.com/redmine/redmine.git
synced 2026-07-06 21:19:48 +02:00
Adds #current_version? method to wiki content.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@7972 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
24
test/fixtures/wiki_content_versions.yml
vendored
24
test/fixtures/wiki_content_versions.yml
vendored
@@ -64,6 +64,8 @@ wiki_content_versions_005:
|
||||
@WHATEVER@
|
||||
|
||||
Maecenas sed elit sit amet mi accumsan vestibulum non nec velit. Proin porta tincidunt lorem, consequat rhoncus dolor fermentum in.
|
||||
|
||||
Cras ipsum felis, ultrices at porttitor vel, faucibus eu nunc.
|
||||
|
||||
h2. Heading 2
|
||||
|
||||
@@ -75,4 +77,26 @@ wiki_content_versions_005:
|
||||
version: 2
|
||||
author_id: 1
|
||||
comments:
|
||||
wiki_content_versions_006:
|
||||
data: |-
|
||||
h1. Title
|
||||
|
||||
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Maecenas sed libero.
|
||||
|
||||
h2. Heading 1
|
||||
|
||||
@WHATEVER@
|
||||
|
||||
Maecenas sed elit sit amet mi accumsan vestibulum non nec velit. Proin porta tincidunt lorem, consequat rhoncus dolor fermentum in.
|
||||
|
||||
h2. Heading 2
|
||||
|
||||
Morbi facilisis accumsan orci non pharetra.
|
||||
updated_on: 2007-03-08 00:18:07 +01:00
|
||||
page_id: 11
|
||||
wiki_content_id: 11
|
||||
id: 6
|
||||
version: 3
|
||||
author_id: 1
|
||||
comments:
|
||||
|
||||
|
||||
@@ -85,4 +85,11 @@ class WikiContentTest < ActiveSupport::TestCase
|
||||
page.reload
|
||||
assert_equal 500.kilobyte, page.content.text.size
|
||||
end
|
||||
|
||||
def test_current_version
|
||||
content = WikiContent.find(11)
|
||||
assert_equal true, content.current_version?
|
||||
assert_equal true, content.versions.first(:order => 'version DESC').current_version?
|
||||
assert_equal false, content.versions.first(:order => 'version ASC').current_version?
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user