プロジェクト

全般

プロフィール

Vote #71591

未完了

Test case test_index_grouped_by_date (documents_controller_test.rb) fails depending upon local timezone.

Admin Redmine さんがほぼ2年前に追加.

ステータス:
New
優先度:
通常
担当者:
-
カテゴリ:
-
対象バージョン:
-
開始日:
2022/05/09
期日:
進捗率:

0%

予定工数:
category_id:
0
version_id:
0
issue_org_id:
10578
author_id:
295
assigned_to_id:
0
comments:
0
status_id:
1
tracker_id:
1
plus1:
0
affected_version:
closed_on:
affected_version_id:
ステータス-->[New]

説明

The fixtures load the documents table with test data that specifies timezone on timestamps of +01:00. (Paris). This persists to the database in local timezone, undergoing timezone conversion in the process. If local timezone is +11:00 this causes the date to be advanced to the next day in the database. The testcase then does an assertion check on the date returned by the controller, and it is returned in the default server (local) timezone, so it does not match the expected value in the test case.

Interestingly this was the only testcase in the whole set that fails for this reason.

Since it appears that most of the test data is in Paris timezone, when the tests are run it would seem desirable to force rails to use Paris as the local timezone, rather than using the server timezone. What is the correct way to do this?

表示するデータがありません

他の形式にエクスポート: Atom PDF

いいね!0