]> source.dussan.org Git - redmine.git/commitdiff
Rails4: replace deprecated Relation#first with finder options at ApiTest::AttachmentsTest
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Fri, 10 Jan 2014 08:37:33 +0000 (08:37 +0000)
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Fri, 10 Jan 2014 08:37:33 +0000 (08:37 +0000)
git-svn-id: http://svn.redmine.org/redmine/trunk@12595 e93f8b46-1217-0410-a6f0-8f06a7374b81

test/integration/api_test/attachments_test.rb

index af2f063fa125dd3c4e3ded37c48c0447c3154165..5bf2ea06acc54c4f10c34101f5b959703337123a 100644 (file)
@@ -87,7 +87,7 @@ class Redmine::ApiTest::AttachmentsTest < Redmine::ApiTest::Base
     token = xml['upload']['token']
     assert_not_nil token
 
-    attachment = Attachment.first(:order => 'id DESC')
+    attachment = Attachment.order('id DESC').first
     assert_equal token, attachment.token
     assert_nil attachment.container
     assert_equal 2, attachment.author_id
@@ -112,7 +112,7 @@ class Redmine::ApiTest::AttachmentsTest < Redmine::ApiTest::Base
     token = json['upload']['token']
     assert_not_nil token
 
-    attachment = Attachment.first(:order => 'id DESC')
+    attachment = Attachment.order('id DESC').first
     assert_equal token, attachment.token
   end