summaryrefslogtreecommitdiffstats
path: root/test/functional/issues_controller_test.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2019-06-20 06:23:48 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2019-06-20 06:23:48 +0000
commit001853ef7951b866089015a7d22e07c787e541a8 (patch)
treef42101bec9faa24cafe1e393b389827f593cd22b /test/functional/issues_controller_test.rb
parent87e82b4894671b222656c93f5255471747267340 (diff)
downloadredmine-001853ef7951b866089015a7d22e07c787e541a8.tar.gz
redmine-001853ef7951b866089015a7d22e07c787e541a8.zip
Groups are incorrect when grouping by date without user timezone set.
git-svn-id: http://svn.redmine.org/redmine/trunk@18264 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/functional/issues_controller_test.rb')
-rw-r--r--test/functional/issues_controller_test.rb24
1 files changed, 23 insertions, 1 deletions
diff --git a/test/functional/issues_controller_test.rb b/test/functional/issues_controller_test.rb
index 3b567220f..746594d1f 100644
--- a/test/functional/issues_controller_test.rb
+++ b/test/functional/issues_controller_test.rb
@@ -355,9 +355,12 @@ class IssuesControllerTest < Redmine::ControllerTest
end
end
- def test_index_grouped_by_created_on
+ def test_index_grouped_by_created_on_if_time_zone_is_utc
skip unless IssueQuery.new.groupable_columns.detect {|c| c.name == :created_on}
+ @request.session[:user_id] = 2
+ User.find(2).pref.update(time_zone: 'UTC')
+
get :index, :params => {
:set_filter => 1,
:group_by => 'created_on'
@@ -369,6 +372,25 @@ class IssuesControllerTest < Redmine::ControllerTest
end
end
+ def test_index_grouped_by_created_on_if_time_zone_is_nil
+ skip unless IssueQuery.new.groupable_columns.detect {|c| c.name == :created_on}
+ current_user = User.find(2)
+ @request.session[:user_id] = current_user.id
+ current_user.pref.update(time_zone: nil)
+
+ get :index, :params => {
+ :set_filter => 1,
+ :group_by => 'created_on'
+ }
+ assert_response :success
+
+ # group_name depends on localtime
+ group_name = format_date(Issue.second.created_on.localtime)
+ assert_select 'tr.group span.name', :text => group_name do
+ assert_select '+ span.count', :text => '2'
+ end
+ end
+
def test_index_grouped_by_created_on_as_pdf
skip unless IssueQuery.new.groupable_columns.detect {|c| c.name == :created_on}