##// END OF EJS Templates
Rails4: replace deprecated Relation#first with finder options at ApiTest::TimeEntriesTest...
Toshi MARUYAMA -
r12331:7f93cc74b4be
parent child
Show More
@@ -62,7 +62,7 class Redmine::ApiTest::TimeEntriesTest < Redmine::ApiTest::Base
62 assert_response :created
62 assert_response :created
63 assert_equal 'application/xml', @response.content_type
63 assert_equal 'application/xml', @response.content_type
64
64
65 entry = TimeEntry.first(:order => 'id DESC')
65 entry = TimeEntry.order('id DESC').first
66 assert_equal 'jsmith', entry.user.login
66 assert_equal 'jsmith', entry.user.login
67 assert_equal Issue.find(1), entry.issue
67 assert_equal Issue.find(1), entry.issue
68 assert_equal Project.find(1), entry.project
68 assert_equal Project.find(1), entry.project
@@ -82,7 +82,7 class Redmine::ApiTest::TimeEntriesTest < Redmine::ApiTest::Base
82 assert_response :created
82 assert_response :created
83 assert_equal 'application/xml', @response.content_type
83 assert_equal 'application/xml', @response.content_type
84
84
85 entry = TimeEntry.first(:order => 'id DESC')
85 entry = TimeEntry.order('id DESC').first
86 assert_equal 'accepted', entry.custom_field_value(field)
86 assert_equal 'accepted', entry.custom_field_value(field)
87 end
87 end
88
88
@@ -93,7 +93,7 class Redmine::ApiTest::TimeEntriesTest < Redmine::ApiTest::Base
93 assert_response :created
93 assert_response :created
94 assert_equal 'application/xml', @response.content_type
94 assert_equal 'application/xml', @response.content_type
95
95
96 entry = TimeEntry.first(:order => 'id DESC')
96 entry = TimeEntry.order('id DESC').first
97 assert_equal 'jsmith', entry.user.login
97 assert_equal 'jsmith', entry.user.login
98 assert_nil entry.issue
98 assert_nil entry.issue
99 assert_equal Project.find(1), entry.project
99 assert_equal Project.find(1), entry.project
General Comments 0
You need to be logged in to leave comments. Login now