assert_equal version_count+1, content.version
assert_equal version_count+1, content.versions.length
- version = WikiContent::Version.first(:order => 'id DESC')
+ version = WikiContent::Version.order('id DESC').first
assert_equal @page.id, version.page_id
assert_equal '', version.compression
assert_equal "My new content", version.data
end
end
- version = WikiContent::Version.first(:order => 'id DESC')
+ version = WikiContent::Version.order('id DESC').first
assert_equal @page.id, version.page_id
assert_equal 'gzip', version.compression
assert_not_equal "My new content", version.data
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?
+ assert_equal true, content.versions.order('version DESC').first.current_version?
+ assert_equal false, content.versions.order('version ASC').first.current_version?
end
def test_previous_for_first_version_should_return_nil