##// END OF EJS Templates
Added tests for Issue#by_X finders...
Eric Davis -
r3250:112fc993114b
parent child
Show More
@@ -589,4 +589,46 class IssueTest < ActiveSupport::TestCase
589 end
589 end
590 end
590 end
591 end
591 end
592
593 test "#by_tracker" do
594 groups = Issue.by_tracker(Project.find(1))
595 assert_equal 3, groups.size
596 assert_equal 7, groups.inject(0) {|sum, group| sum + group['total'].to_i}
597 end
598
599 test "#by_version" do
600 groups = Issue.by_version(Project.find(1))
601 assert_equal 3, groups.size
602 assert_equal 3, groups.inject(0) {|sum, group| sum + group['total'].to_i}
603 end
604
605 test "#by_priority" do
606 groups = Issue.by_priority(Project.find(1))
607 assert_equal 4, groups.size
608 assert_equal 7, groups.inject(0) {|sum, group| sum + group['total'].to_i}
609 end
610
611 test "#by_category" do
612 groups = Issue.by_category(Project.find(1))
613 assert_equal 2, groups.size
614 assert_equal 3, groups.inject(0) {|sum, group| sum + group['total'].to_i}
615 end
616
617 test "#by_assigned_to" do
618 groups = Issue.by_assigned_to(Project.find(1))
619 assert_equal 2, groups.size
620 assert_equal 2, groups.inject(0) {|sum, group| sum + group['total'].to_i}
621 end
622
623 test "#by_author" do
624 groups = Issue.by_author(Project.find(1))
625 assert_equal 4, groups.size
626 assert_equal 7, groups.inject(0) {|sum, group| sum + group['total'].to_i}
627 end
628
629 test "#by_subproject" do
630 groups = Issue.by_subproject(Project.find(1))
631 assert_equal 2, groups.size
632 assert_equal 5, groups.inject(0) {|sum, group| sum + group['total'].to_i}
633 end
592 end
634 end
General Comments 0
You need to be logged in to leave comments. Login now