kanbanworkflowstimelinescrumrubyroadmapproject-planningproject-managementopenprojectangularissue-trackerifcgantt-chartganttbug-trackerboardsbcf
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
102 lines
3.0 KiB
102 lines
3.0 KiB
13 years ago
|
#-- encoding: UTF-8
|
||
14 years ago
|
#-- copyright
|
||
|
# ChiliProject is a project management system.
|
||
14 years ago
|
#
|
||
14 years ago
|
# Copyright (C) 2010-2011 the ChiliProject Team
|
||
14 years ago
|
#
|
||
14 years ago
|
# This program is free software; you can redistribute it and/or
|
||
|
# modify it under the terms of the GNU General Public License
|
||
|
# as published by the Free Software Foundation; either version 2
|
||
|
# of the License, or (at your option) any later version.
|
||
14 years ago
|
#
|
||
14 years ago
|
# See doc/COPYRIGHT.rdoc for more details.
|
||
|
#++
|
||
|
|
||
12 years ago
|
require File.expand_path('../../../test_helper', __FILE__)
|
||
15 years ago
|
|
||
12 years ago
|
class Issues::GanttsControllerTest < ActionController::TestCase
|
||
15 years ago
|
fixtures :all
|
||
|
|
||
|
context "#gantt" do
|
||
|
should "work" do
|
||
14 years ago
|
i2 = Issue.find(2)
|
||
|
i2.update_attribute(:due_date, 1.month.from_now)
|
||
14 years ago
|
|
||
12 years ago
|
get :index, :project_id => 1
|
||
15 years ago
|
assert_response :success
|
||
12 years ago
|
assert_template 'show'
|
||
15 years ago
|
assert_not_nil assigns(:gantt)
|
||
|
# Issue with start and due dates
|
||
|
i = Issue.find(1)
|
||
|
assert_not_nil i.due_date
|
||
14 years ago
|
assert_select "div a.issue", /##{i.id}/
|
||
|
# Issue with on a targeted version should not be in the events but loaded in the html
|
||
15 years ago
|
i = Issue.find(2)
|
||
14 years ago
|
assert_select "div a.issue", /##{i.id}/
|
||
15 years ago
|
end
|
||
14 years ago
|
|
||
14 years ago
|
should "work without issue due dates" do
|
||
14 years ago
|
Issue.update_all("due_date = NULL")
|
||
14 years ago
|
|
||
12 years ago
|
get :index, :project_id => 1
|
||
14 years ago
|
assert_response :success
|
||
12 years ago
|
assert_template 'show'
|
||
14 years ago
|
assert_not_nil assigns(:gantt)
|
||
|
end
|
||
14 years ago
|
|
||
14 years ago
|
should "work without issue and version due dates" do
|
||
|
Issue.update_all("due_date = NULL")
|
||
|
Version.update_all("effective_date = NULL")
|
||
14 years ago
|
|
||
12 years ago
|
get :index, :project_id => 1
|
||
14 years ago
|
assert_response :success
|
||
12 years ago
|
assert_template 'show'
|
||
14 years ago
|
assert_not_nil assigns(:gantt)
|
||
|
end
|
||
15 years ago
|
|
||
|
should "work cross project" do
|
||
12 years ago
|
get :index
|
||
15 years ago
|
assert_response :success
|
||
12 years ago
|
assert_template 'show'
|
||
15 years ago
|
assert_not_nil assigns(:gantt)
|
||
14 years ago
|
assert_not_nil assigns(:gantt).query
|
||
|
assert_nil assigns(:gantt).project
|
||
15 years ago
|
end
|
||
|
|
||
14 years ago
|
should "not disclose private projects" do
|
||
12 years ago
|
get :index
|
||
14 years ago
|
assert_response :success
|
||
12 years ago
|
assert_template 'show'
|
||
14 years ago
|
|
||
14 years ago
|
assert_tag 'a', :content => /eCookbook/
|
||
|
# Root private project
|
||
|
assert_no_tag 'a', {:content => /OnlineStore/}
|
||
|
# Private children of a public project
|
||
|
assert_no_tag 'a', :content => /Private child of eCookbook/
|
||
|
end
|
||
|
|
||
15 years ago
|
should "export to pdf" do
|
||
12 years ago
|
get :index, :project_id => 1, :format => 'pdf'
|
||
15 years ago
|
assert_response :success
|
||
|
assert_equal 'application/pdf', @response.content_type
|
||
|
assert @response.body.starts_with?('%PDF')
|
||
|
assert_not_nil assigns(:gantt)
|
||
|
end
|
||
|
|
||
|
should "export to pdf cross project" do
|
||
12 years ago
|
get :index, :format => 'pdf'
|
||
15 years ago
|
assert_response :success
|
||
|
assert_equal 'application/pdf', @response.content_type
|
||
|
assert @response.body.starts_with?('%PDF')
|
||
|
assert_not_nil assigns(:gantt)
|
||
|
end
|
||
14 years ago
|
|
||
15 years ago
|
should "export to png" do
|
||
12 years ago
|
get :index, :project_id => 1, :format => 'png'
|
||
15 years ago
|
assert_response :success
|
||
|
assert_equal 'image/png', @response.content_type
|
||
|
end if Object.const_defined?(:Magick)
|
||
|
|
||
|
end
|
||
|
end
|