プロジェクト

全般

プロフィール

Vote #79928

完了

TimelogTest#test_default_query_setting fails depending on the language of the browser

Admin Redmine さんが3年以上前に追加. 3年以上前に更新.

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

0%

予定工数:
category_id:
30
version_id:
127
issue_org_id:
31074
author_id:
332
assigned_to_id:
332
comments:
2
status_id:
5
tracker_id:
1
plus1:
0
affected_version:
closed_on:
affected_version_id:
ステータス-->[Closed]

説明

The test fails in some environment.

Failure:
TimelogTest#test_default_query_setting [/Users/maeda/redmines/redmine-trunk/test/system/timelog_test.rb:82]:
Expected false to be truthy.


bin/rails test test/system/timelog_test.rb:77

This is because the test expects the current language is always English, but actually the language is auto-selected depending on the test environment. For example, Japanese is the default language in my environment. The test looks for a table header "Comment" and fails because there is a Japanese text "コメント" instead of "Comment".

!{width: 1024px; border: 1px solid #ccc;}.test_default_query_setting-fails@2x.png!


journals

Forcing the English language for anonymous users fixes the issue.

<pre><code class="diff">
diff --git a/test/system/timelog_test.rb b/test/system/timelog_test.rb
index 58886c050..7c637d6cd 100644
--- a/test/system/timelog_test.rb
+++ b/test/system/timelog_test.rb
@@ -75,11 +75,13 @@ class TimelogTest < ApplicationSystemTestCase
end

def test_default_query_setting
- # Display the list with the default settings
- visit '/time_entries'
- within 'table.time-entries thead' do
- assert page.has_no_link?('Tracker')
- assert page.has_text?('Comment')
+ with_settings :default_language => 'en', :force_default_language_for_anonymous => '1' do
+ # Display the list with the default settings
+ visit '/time_entries'
+ within 'table.time-entries thead' do
+ assert page.has_no_link?('Tracker')
+ assert page.has_text?('Comment')
+ end
end

# Change the default columns
</code></pre>
--------------------------------------------------------------------------------
Committed.
--------------------------------------------------------------------------------

Admin Redmine さんが3年以上前に更新

  • カテゴリCode cleanup/refactoring_30 にセット
  • 対象バージョン4.1.0_127 にセット

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

いいね!0
いいね!0