Mercurial > hg > soundsoftware-site
comparison test/functional/gantts_controller_test.rb @ 22:40f7cfd4df19
* Update to SVN trunk rev 4173
author | Chris Cannam <chris.cannam@soundsoftware.ac.uk> |
---|---|
date | Fri, 24 Sep 2010 14:06:04 +0100 |
parents | 1d32c0a0efbf |
children | 94944d00e43c |
comparison
equal
deleted
inserted
replaced
14:1d32c0a0efbf | 22:40f7cfd4df19 |
---|---|
3 class GanttsControllerTest < ActionController::TestCase | 3 class GanttsControllerTest < ActionController::TestCase |
4 fixtures :all | 4 fixtures :all |
5 | 5 |
6 context "#gantt" do | 6 context "#gantt" do |
7 should "work" do | 7 should "work" do |
8 i2 = Issue.find(2) | |
9 i2.update_attribute(:due_date, 1.month.from_now) | |
10 | |
8 get :show, :project_id => 1 | 11 get :show, :project_id => 1 |
9 assert_response :success | 12 assert_response :success |
10 assert_template 'show.html.erb' | 13 assert_template 'show.html.erb' |
11 assert_not_nil assigns(:gantt) | 14 assert_not_nil assigns(:gantt) |
12 events = assigns(:gantt).events | |
13 assert_not_nil events | |
14 # Issue with start and due dates | 15 # Issue with start and due dates |
15 i = Issue.find(1) | 16 i = Issue.find(1) |
16 assert_not_nil i.due_date | 17 assert_not_nil i.due_date |
17 assert events.include?(Issue.find(1)) | 18 assert_select "div a.issue", /##{i.id}/ |
18 # Issue with without due date but targeted to a version with date | 19 # Issue with on a targeted version should not be in the events but loaded in the html |
19 i = Issue.find(2) | 20 i = Issue.find(2) |
20 assert_nil i.due_date | 21 assert_select "div a.issue", /##{i.id}/ |
21 assert events.include?(i) | |
22 end | 22 end |
23 | 23 |
24 should "work cross project" do | 24 should "work cross project" do |
25 get :show | 25 get :show |
26 assert_response :success | 26 assert_response :success |
27 assert_template 'show.html.erb' | 27 assert_template 'show.html.erb' |
28 assert_not_nil assigns(:gantt) | 28 assert_not_nil assigns(:gantt) |
29 events = assigns(:gantt).events | 29 assert_not_nil assigns(:gantt).query |
30 assert_not_nil events | 30 assert_nil assigns(:gantt).project |
31 end | 31 end |
32 | 32 |
33 should "export to pdf" do | 33 should "export to pdf" do |
34 get :show, :project_id => 1, :format => 'pdf' | 34 get :show, :project_id => 1, :format => 'pdf' |
35 assert_response :success | 35 assert_response :success |