Rails4: replace deprecated Relation#first with finder options at ApiTest::TimeEntriesTest

git-svn-id: http://svn.redmine.org/redmine/trunk@12606 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Toshi MARUYAMA 2014-01-10 11:24:34 +00:00
parent 505483f224
commit 7f93cc74b4
1 changed files with 3 additions and 3 deletions

View File

@ -62,7 +62,7 @@ class Redmine::ApiTest::TimeEntriesTest < Redmine::ApiTest::Base
assert_response :created
assert_equal 'application/xml', @response.content_type
entry = TimeEntry.first(:order => 'id DESC')
entry = TimeEntry.order('id DESC').first
assert_equal 'jsmith', entry.user.login
assert_equal Issue.find(1), entry.issue
assert_equal Project.find(1), entry.project
@ -82,7 +82,7 @@ class Redmine::ApiTest::TimeEntriesTest < Redmine::ApiTest::Base
assert_response :created
assert_equal 'application/xml', @response.content_type
entry = TimeEntry.first(:order => 'id DESC')
entry = TimeEntry.order('id DESC').first
assert_equal 'accepted', entry.custom_field_value(field)
end
@ -93,7 +93,7 @@ class Redmine::ApiTest::TimeEntriesTest < Redmine::ApiTest::Base
assert_response :created
assert_equal 'application/xml', @response.content_type
entry = TimeEntry.first(:order => 'id DESC')
entry = TimeEntry.order('id DESC').first
assert_equal 'jsmith', entry.user.login
assert_nil entry.issue
assert_equal Project.find(1), entry.project