From 46671966c92bc1070fbc7986032fe160389899a2 Mon Sep 17 00:00:00 2001 From: Go MAEDA Date: Fri, 29 Jun 2018 07:11:56 +0000 Subject: [PATCH] Test for r17421 (#26091). Patch by Marius BALTEANU. git-svn-id: http://svn.redmine.org/redmine/trunk@17424 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- test/functional/queries_controller_test.rb | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/test/functional/queries_controller_test.rb b/test/functional/queries_controller_test.rb index 93229c423..95874346c 100644 --- a/test/functional/queries_controller_test.rb +++ b/test/functional/queries_controller_test.rb @@ -605,7 +605,10 @@ class QueriesControllerTest < Redmine::ControllerTest assert_include ["eCookbook - 2.0", "3", "open"], json end - def test_filter_without_project_id_should_return_filter_values + def test_filter_without_project_id_should_return_all_visible_fixed_versions + # Remove "jsmith" user from "Private child of eCookbook" project + Project.find(5).memberships.find_by(:user_id => 2).destroy + @request.session[:user_id] = 2 get :filter, :params => { :name => 'fixed_version_id' @@ -614,7 +617,15 @@ class QueriesControllerTest < Redmine::ControllerTest assert_response :success assert_equal 'application/json', response.content_type json = ActiveSupport::JSON.decode(response.body) + + # response includes visible version + assert_include ["eCookbook Subproject 1 - 2.0", "4", "open"], json + assert_include ["eCookbook - 0.1", "1", "closed"], json + # response includes systemwide visible version assert_include ["OnlineStore - Systemwide visible version", "7", "open"], json + # response doesn't include non visible version + refute_includes ["Private child of eCookbook - Private Version of public subproject", "6", "open"], json + end def test_subproject_filter_time_entries_with_project_id_should_return_filter_values