##// END OF EJS Templates
Add missing tests for Redmine::Helpers::Gantt#number_of_rows....
Jean-Baptiste Barth -
r11541:208d6d881c6f
parent child
Show More
@@ -57,11 +57,26 class Redmine::Helpers::GanttHelperTest < ActionView::TestCase
57 57
58 58 context "#number_of_rows" do
59 59 context "with one project" do
60 should "return the number of rows just for that project"
60 should "return the number of rows just for that project" do
61 p1, p2 = Project.generate!, Project.generate!
62 i1, i2 = Issue.generate!(:project => p1), Issue.generate!(:project => p2)
63 create_gantt(p1)
64 assert_equal 2, @gantt.number_of_rows
65 end
61 66 end
62 67
63 68 context "with no project" do
64 should "return the total number of rows for all the projects, resursively"
69 should "return the total number of rows for all the projects, resursively" do
70 p1, p2 = Project.generate!, Project.generate!
71 create_gantt(nil)
72 #fix the return value of #number_of_rows_on_project() to an arbitrary value
73 #so that we really only test #number_of_rows
74 @gantt.stubs(:number_of_rows_on_project).returns(7)
75 #also fix #projects because we want to test #number_of_rows in isolation
76 @gantt.stubs(:projects).returns(Project.all)
77 #actual test
78 assert_equal Project.count*7, @gantt.number_of_rows
79 end
65 80 end
66 81
67 82 should "not exceed max_rows option" do
General Comments 0
You need to be logged in to leave comments. Login now