]> source.dussan.org Git - redmine.git/commitdiff
Rails4: replace deprecated Relation#first with finder options at NewsControllerTest
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Wed, 8 Jan 2014 06:26:25 +0000 (06:26 +0000)
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Wed, 8 Jan 2014 06:26:25 +0000 (06:26 +0000)
git-svn-id: http://svn.redmine.org/redmine/trunk@12522 e93f8b46-1217-0410-a6f0-8f06a7374b81

test/functional/news_controller_test.rb

index 43ae05a5ffa0a53df5982a05470057f01bfe56ce..5320cd29367943a9bd75e21d9e1070c644dccc9d 100644 (file)
@@ -102,8 +102,8 @@ class NewsControllerTest < ActionController::TestCase
           :attachments => {'1' => {'file' => uploaded_test_file('testfile.txt', 'text/plain')}}
       end
     end
-    attachment = Attachment.first(:order => 'id DESC')
-    news = News.first(:order => 'id DESC')
+    attachment = Attachment.order('id DESC').first
+    news = News.order('id DESC').first
     assert_equal news, attachment.container
   end