summaryrefslogtreecommitdiffstats
path: root/test/functional/queries_controller_test.rb
diff options
context:
space:
mode:
authorGo MAEDA <maeda@farend.jp>2018-06-29 07:11:56 +0000
committerGo MAEDA <maeda@farend.jp>2018-06-29 07:11:56 +0000
commit46671966c92bc1070fbc7986032fe160389899a2 (patch)
treefc39c9e522eec1a8004c136530d7fb123467edbf /test/functional/queries_controller_test.rb
parent2149e1bfbefc324580ae28837c705533f119f530 (diff)
downloadredmine-46671966c92bc1070fbc7986032fe160389899a2.tar.gz
redmine-46671966c92bc1070fbc7986032fe160389899a2.zip
Test for r17421 (#26091).
Patch by Marius BALTEANU. git-svn-id: http://svn.redmine.org/redmine/trunk@17424 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/functional/queries_controller_test.rb')
-rw-r--r--test/functional/queries_controller_test.rb13
1 files changed, 12 insertions, 1 deletions
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