summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorGo MAEDA <maeda@farend.jp>2023-03-01 08:47:28 +0000
committerGo MAEDA <maeda@farend.jp>2023-03-01 08:47:28 +0000
commit4dc56cd943b6cb5cfaae8bd21db2c8ef82e7a50c (patch)
tree02cb6588ca4609f93f5ea23919d72820361fc65a /test
parenta499d688021a5ba9f7cb8dba18bb3dc6b0199073 (diff)
downloadredmine-4dc56cd943b6cb5cfaae8bd21db2c8ef82e7a50c.tar.gz
redmine-4dc56cd943b6cb5cfaae8bd21db2c8ef82e7a50c.zip
Exporting UserQuery does not use the query name as file name (#37674, #38182).
Patch by Takenori TAKAKI. git-svn-id: https://svn.redmine.org/redmine/trunk@22121 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test')
-rw-r--r--test/functional/users_controller_test.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/functional/users_controller_test.rb b/test/functional/users_controller_test.rb
index ccb40ce4c..e452371ff 100644
--- a/test/functional/users_controller_test.rb
+++ b/test/functional/users_controller_test.rb
@@ -280,6 +280,19 @@ class UsersControllerTest < Redmine::ControllerTest
assert_equal 'text/csv; header=present', @response.media_type
end
+ def test_index_csv_filename_without_query_id_param
+ get :index, :params => {:format => 'csv'}
+ assert_response :success
+ assert_match /users.csv/, @response.headers['Content-Disposition']
+ end
+
+ def test_index_csv_filename_with_query_id_param
+ query = UserQuery.create!(:name => 'My Query Name', :visibility => UserQuery::VISIBILITY_PUBLIC)
+ get :index, :params => {:query_id => query.id, :format => 'csv'}
+ assert_response :success
+ assert_match /my_query_name\.csv/, @response.headers['Content-Disposition']
+ end
+
def test_show
@request.session[:user_id] = nil
get :show, :params => {:id => 2}