From: Toshi MARUYAMA Date: Thu, 9 Jan 2014 06:43:49 +0000 (+0000) Subject: Rails4: replace deprecated Relation#first with finder options at WikiContentTest X-Git-Tag: 2.5.0~334 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=a6da09026a33a85cc37d040acdaafdfc0317ce34;p=redmine.git Rails4: replace deprecated Relation#first with finder options at WikiContentTest git-svn-id: http://svn.redmine.org/redmine/trunk@12565 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- diff --git a/test/unit/wiki_content_test.rb b/test/unit/wiki_content_test.rb index 10d9cea8a..2e5f4a2d4 100644 --- a/test/unit/wiki_content_test.rb +++ b/test/unit/wiki_content_test.rb @@ -67,7 +67,7 @@ class WikiContentTest < ActiveSupport::TestCase 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 @@ -83,7 +83,7 @@ class WikiContentTest < ActiveSupport::TestCase 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 @@ -121,8 +121,8 @@ class WikiContentTest < ActiveSupport::TestCase 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