diff --git a/test/functional/queries_controller_test.rb b/test/functional/queries_controller_test.rb index 93229c4..580fa0d 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_version_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,14 @@ 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