summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2013-07-14 13:41:30 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2013-07-14 13:41:30 +0000
commit010bfc56e15f442e4e597ddc9c436361c61b1e7a (patch)
tree498f9a9cea5fac71c0f63c1a2f92ad02ed6f6470 /test
parent3c9263221d3d914b3e6b5f0b8c66ebd859d75403 (diff)
downloadredmine-010bfc56e15f442e4e597ddc9c436361c61b1e7a.tar.gz
redmine-010bfc56e15f442e4e597ddc9c436361c61b1e7a.zip
Ability to save Gantt query filters (#7836).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@12020 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test')
-rw-r--r--test/functional/queries_controller_test.rb37
1 files changed, 37 insertions, 0 deletions
diff --git a/test/functional/queries_controller_test.rb b/test/functional/queries_controller_test.rb
index b2bbb22fd..d01513984 100644
--- a/test/functional/queries_controller_test.rb
+++ b/test/functional/queries_controller_test.rb
@@ -155,6 +155,43 @@ class QueriesControllerTest < ActionController::TestCase
assert_select 'input[name=?]', 'query[name]'
end
+ def test_create_global_query_from_gantt
+ @request.session[:user_id] = 1
+ assert_difference 'IssueQuery.count' do
+ post :create,
+ :gantt => 1,
+ :operators => {"status_id" => "o"},
+ :values => {"status_id" => ["1"]},
+ :query => {:name => "test_create_from_gantt",
+ :draw_relations => '1',
+ :draw_progress_line => '1'}
+ assert_response 302
+ end
+ query = IssueQuery.order('id DESC').first
+ assert_redirected_to "/issues/gantt?query_id=#{query.id}"
+ assert_equal true, query.draw_relations
+ assert_equal true, query.draw_progress_line
+ end
+
+ def test_create_project_query_from_gantt
+ @request.session[:user_id] = 1
+ assert_difference 'IssueQuery.count' do
+ post :create,
+ :project_id => 'ecookbook',
+ :gantt => 1,
+ :operators => {"status_id" => "o"},
+ :values => {"status_id" => ["1"]},
+ :query => {:name => "test_create_from_gantt",
+ :draw_relations => '0',
+ :draw_progress_line => '0'}
+ assert_response 302
+ end
+ query = IssueQuery.order('id DESC').first
+ assert_redirected_to "/projects/ecookbook/issues/gantt?query_id=#{query.id}"
+ assert_equal false, query.draw_relations
+ assert_equal false, query.draw_progress_line
+ end
+
def test_edit_global_public_query
@request.session[:user_id] = 1
get :edit, :id => 4