diff options
author | Toshi MARUYAMA <marutosijp2@yahoo.co.jp> | 2014-01-09 06:43:49 +0000 |
---|---|---|
committer | Toshi MARUYAMA <marutosijp2@yahoo.co.jp> | 2014-01-09 06:43:49 +0000 |
commit | a6da09026a33a85cc37d040acdaafdfc0317ce34 (patch) | |
tree | cf8921f0895c9fb474e243b70fd1de50f3a2a2ea /test/unit/wiki_content_test.rb | |
parent | d305d15373ddd807621794497847284adddcd3e5 (diff) | |
download | redmine-a6da09026a33a85cc37d040acdaafdfc0317ce34.tar.gz redmine-a6da09026a33a85cc37d040acdaafdfc0317ce34.zip |
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
Diffstat (limited to 'test/unit/wiki_content_test.rb')
-rw-r--r-- | test/unit/wiki_content_test.rb | 8 |
1 files changed, 4 insertions, 4 deletions
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 |