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:
parent
2b36ff7016
commit
74ccf34361
test/unit
|
@ -26,13 +26,13 @@ class IssueCategoryTest < ActiveSupport::TestCase
|
|||
|
||||
def test_create
|
||||
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
|
||||
end
|
||||
|
||||
def test_create_with_group_assignment
|
||||
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_equal Group.find(11), category.assigned_to
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue