summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Davis <edavis@littlestreamsoftware.com>2010-02-04 17:24:28 +0000
committerEric Davis <edavis@littlestreamsoftware.com>2010-02-04 17:24:28 +0000
commit112fc993114ba43b94a19d168aaf94fe60873054 (patch)
treef41482c4fd8522a5fc05b92d86227aa461201304
parent155083ec9722e2c01ec3323d7a421fa059a80ba9 (diff)
downloadredmine-112fc993114ba43b94a19d168aaf94fe60873054.tar.gz
redmine-112fc993114ba43b94a19d168aaf94fe60873054.zip
Added tests for Issue#by_X finders
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@3364 e93f8b46-1217-0410-a6f0-8f06a7374b81
-rw-r--r--test/unit/issue_test.rb42
1 files changed, 42 insertions, 0 deletions
diff --git a/test/unit/issue_test.rb b/test/unit/issue_test.rb
index b22b05c78..86d3e2455 100644
--- a/test/unit/issue_test.rb
+++ b/test/unit/issue_test.rb
@@ -589,4 +589,46 @@ class IssueTest < ActiveSupport::TestCase
end
end
end
+
+ test "#by_tracker" do
+ groups = Issue.by_tracker(Project.find(1))
+ assert_equal 3, groups.size
+ assert_equal 7, groups.inject(0) {|sum, group| sum + group['total'].to_i}
+ end
+
+ test "#by_version" do
+ groups = Issue.by_version(Project.find(1))
+ assert_equal 3, groups.size
+ assert_equal 3, groups.inject(0) {|sum, group| sum + group['total'].to_i}
+ end
+
+ test "#by_priority" do
+ groups = Issue.by_priority(Project.find(1))
+ assert_equal 4, groups.size
+ assert_equal 7, groups.inject(0) {|sum, group| sum + group['total'].to_i}
+ end
+
+ test "#by_category" do
+ groups = Issue.by_category(Project.find(1))
+ assert_equal 2, groups.size
+ assert_equal 3, groups.inject(0) {|sum, group| sum + group['total'].to_i}
+ end
+
+ test "#by_assigned_to" do
+ groups = Issue.by_assigned_to(Project.find(1))
+ assert_equal 2, groups.size
+ assert_equal 2, groups.inject(0) {|sum, group| sum + group['total'].to_i}
+ end
+
+ test "#by_author" do
+ groups = Issue.by_author(Project.find(1))
+ assert_equal 4, groups.size
+ assert_equal 7, groups.inject(0) {|sum, group| sum + group['total'].to_i}
+ end
+
+ test "#by_subproject" do
+ groups = Issue.by_subproject(Project.find(1))
+ assert_equal 2, groups.size
+ assert_equal 5, groups.inject(0) {|sum, group| sum + group['total'].to_i}
+ end
end