Mercurial > hg > soundsoftware-site
comparison test/functional/gantts_controller_test.rb @ 524:1248a47e81b3 feature_36
Merge from branch "luisf"
author | luisf <luis.figueira@eecs.qmul.ac.uk> |
---|---|
date | Mon, 25 Jul 2011 14:39:38 +0100 |
parents | af80e5618e9b |
children | cbb26bc654de |
comparison
equal
deleted
inserted
replaced
519:3be6bc3c2a17 | 524:1248a47e81b3 |
---|---|
1 require File.dirname(__FILE__) + '/../test_helper' | 1 require File.expand_path('../../test_helper', __FILE__) |
2 | 2 |
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 |
47 assert_not_nil assigns(:gantt) | 47 assert_not_nil assigns(:gantt) |
48 assert_not_nil assigns(:gantt).query | 48 assert_not_nil assigns(:gantt).query |
49 assert_nil assigns(:gantt).project | 49 assert_nil assigns(:gantt).project |
50 end | 50 end |
51 | 51 |
52 should "not disclose private projects" do | |
53 get :show | |
54 assert_response :success | |
55 assert_template 'show.html.erb' | |
56 | |
57 assert_tag 'a', :content => /eCookbook/ | |
58 # Root private project | |
59 assert_no_tag 'a', {:content => /OnlineStore/} | |
60 # Private children of a public project | |
61 assert_no_tag 'a', :content => /Private child of eCookbook/ | |
62 end | |
63 | |
52 should "export to pdf" do | 64 should "export to pdf" do |
53 get :show, :project_id => 1, :format => 'pdf' | 65 get :show, :project_id => 1, :format => 'pdf' |
54 assert_response :success | 66 assert_response :success |
55 assert_equal 'application/pdf', @response.content_type | 67 assert_equal 'application/pdf', @response.content_type |
56 assert @response.body.starts_with?('%PDF') | 68 assert @response.body.starts_with?('%PDF') |