##// END OF EJS Templates
replace shoulda to Rails standard tests at functional gantts controller test...
Toshi MARUYAMA -
r9878:eb6260314400
parent child
Show More
@@ -11,11 +11,9 class GanttsControllerTest < ActionController::TestCase
11 11 :workflows,
12 12 :versions
13 13
14 context "#gantt" do
15 should "work" do
14 def test_gantt_should_work
16 15 i2 = Issue.find(2)
17 16 i2.update_attribute(:due_date, 1.month.from_now)
18
19 17 get :show, :project_id => 1
20 18 assert_response :success
21 19 assert_template 'gantts/show'
@@ -29,26 +27,24 class GanttsControllerTest < ActionController::TestCase
29 27 assert_select "div a.issue", /##{i.id}/
30 28 end
31 29
32 should "work without issue due dates" do
30 def test_gantt_should_work_without_issue_due_dates
33 31 Issue.update_all("due_date = NULL")
34
35 32 get :show, :project_id => 1
36 33 assert_response :success
37 34 assert_template 'gantts/show'
38 35 assert_not_nil assigns(:gantt)
39 36 end
40 37
41 should "work without issue and version due dates" do
38 def test_gantt_should_work_without_issue_and_version_due_dates
42 39 Issue.update_all("due_date = NULL")
43 40 Version.update_all("effective_date = NULL")
44
45 41 get :show, :project_id => 1
46 42 assert_response :success
47 43 assert_template 'gantts/show'
48 44 assert_not_nil assigns(:gantt)
49 45 end
50 46
51 should "work cross project" do
47 def test_gantt_should_work_cross_project
52 48 get :show
53 49 assert_response :success
54 50 assert_template 'gantts/show'
@@ -57,11 +53,10 class GanttsControllerTest < ActionController::TestCase
57 53 assert_nil assigns(:gantt).project
58 54 end
59 55
60 should "not disclose private projects" do
56 def test_gantt_should_not_disclose_private_projects
61 57 get :show
62 58 assert_response :success
63 59 assert_template 'gantts/show'
64
65 60 assert_tag 'a', :content => /eCookbook/
66 61 # Root private project
67 62 assert_no_tag 'a', {:content => /OnlineStore/}
@@ -69,7 +64,7 class GanttsControllerTest < ActionController::TestCase
69 64 assert_no_tag 'a', :content => /Private child of eCookbook/
70 65 end
71 66
72 should "export to pdf" do
67 def test_gantt_should_export_to_pdf
73 68 get :show, :project_id => 1, :format => 'pdf'
74 69 assert_response :success
75 70 assert_equal 'application/pdf', @response.content_type
@@ -77,7 +72,7 class GanttsControllerTest < ActionController::TestCase
77 72 assert_not_nil assigns(:gantt)
78 73 end
79 74
80 should "export to pdf cross project" do
75 def test_gantt_should_export_to_pdf_cross_project
81 76 get :show, :format => 'pdf'
82 77 assert_response :success
83 78 assert_equal 'application/pdf', @response.content_type
@@ -85,11 +80,11 class GanttsControllerTest < ActionController::TestCase
85 80 assert_not_nil assigns(:gantt)
86 81 end
87 82
88 should "export to png" do
89 get :show, :project_id => 1, :format => 'png'
90 assert_response :success
91 assert_equal 'image/png', @response.content_type
92 end if Object.const_defined?(:Magick)
93
94 end
83 if Object.const_defined?(:Magick)
84 def test_gantt_should_export_to_png
85 get :show, :project_id => 1, :format => 'png'
86 assert_response :success
87 assert_equal 'image/png', @response.content_type
88 end
89 end
95 90 end
General Comments 0
You need to be logged in to leave comments. Login now