Rails4: replace deprecated Relation#first with finder options at IssueCategoryTest

git-svn-id: http://svn.redmine.org/redmine/trunk@12525 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Toshi MARUYAMA 2014-01-08 10:11:00 +00:00
parent 2b36ff7016
commit 74ccf34361

View File

@ -26,13 +26,13 @@ class IssueCategoryTest < ActiveSupport::TestCase
def test_create def test_create
assert IssueCategory.new(:project_id => 2, :name => 'New category').save assert IssueCategory.new(:project_id => 2, :name => 'New category').save
category = IssueCategory.first(:order => 'id DESC') category = IssueCategory.order('id DESC').first
assert_equal 'New category', category.name assert_equal 'New category', category.name
end end
def test_create_with_group_assignment def test_create_with_group_assignment
assert IssueCategory.new(:project_id => 2, :name => 'Group assignment', :assigned_to_id => 11).save assert IssueCategory.new(:project_id => 2, :name => 'Group assignment', :assigned_to_id => 11).save
category = IssueCategory.first(:order => 'id DESC') category = IssueCategory.order('id DESC').first
assert_kind_of Group, category.assigned_to assert_kind_of Group, category.assigned_to
assert_equal Group.find(11), category.assigned_to assert_equal Group.find(11), category.assigned_to
end end