鏡像自
https://github.com/redmine/redmine.git
synced 2024-07-28 08:17:39 +02:00
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:
父節點
2b36ff7016
當前提交
74ccf34361
@ -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
|
||||
|
載入中…
新增問題並參考
Block a user