Mercurial > hg > soundsoftware-site
comparison test/unit/issue_category_test.rb @ 1526:404aa68d4227
Merge from live branch
author | Chris Cannam |
---|---|
date | Thu, 11 Sep 2014 12:46:20 +0100 |
parents | dffacf8a6908 |
children |
comparison
equal
deleted
inserted
replaced
1493:a5f2bdf3b486 | 1526:404aa68d4227 |
---|---|
1 # Redmine - project management software | 1 # Redmine - project management software |
2 # Copyright (C) 2006-2012 Jean-Philippe Lang | 2 # Copyright (C) 2006-2014 Jean-Philippe Lang |
3 # | 3 # |
4 # This program is free software; you can redistribute it and/or | 4 # This program is free software; you can redistribute it and/or |
5 # modify it under the terms of the GNU General Public License | 5 # modify it under the terms of the GNU General Public License |
6 # as published by the Free Software Foundation; either version 2 | 6 # as published by the Free Software Foundation; either version 2 |
7 # of the License, or (at your option) any later version. | 7 # of the License, or (at your option) any later version. |
24 @category = IssueCategory.find(1) | 24 @category = IssueCategory.find(1) |
25 end | 25 end |
26 | 26 |
27 def test_create | 27 def test_create |
28 assert IssueCategory.new(:project_id => 2, :name => 'New category').save | 28 assert IssueCategory.new(:project_id => 2, :name => 'New category').save |
29 category = IssueCategory.first(:order => 'id DESC') | 29 category = IssueCategory.order('id DESC').first |
30 assert_equal 'New category', category.name | 30 assert_equal 'New category', category.name |
31 end | 31 end |
32 | 32 |
33 def test_create_with_group_assignment | 33 def test_create_with_group_assignment |
34 assert IssueCategory.new(:project_id => 2, :name => 'Group assignment', :assigned_to_id => 11).save | 34 assert IssueCategory.new(:project_id => 2, :name => 'Group assignment', :assigned_to_id => 11).save |
35 category = IssueCategory.first(:order => 'id DESC') | 35 category = IssueCategory.order('id DESC').first |
36 assert_kind_of Group, category.assigned_to | 36 assert_kind_of Group, category.assigned_to |
37 assert_equal Group.find(11), category.assigned_to | 37 assert_equal Group.find(11), category.assigned_to |
38 end | 38 end |
39 | 39 |
40 def test_destroy | 40 def test_destroy |