Defect #30806

TimeEntryTest#test_create_should_validate_user_id occasionally fails

Added by Go MAEDA 8 months ago. Updated 8 months ago.

Status:ClosedStart date:
Priority:NormalDue date:
Assignee:Go MAEDA% Done:

0%

Category:Code cleanup/refactoring
Target version:4.1.0
Resolution:Fixed Affected version:

Description

You can always reproduce it by running tests with "--seed 20474" option.

$ bin/rails test --seed 20474
.
.
(snip)
.
.
...........................................................F

Failure:
TimeEntryTest#test_create_should_validate_user_id [/Users/maeda/redmines/redmine-trunk/test/unit/time_entry_test.rb:245]:
--- expected
+++ actual
@@ -1 +1 @@
-["User is invalid"]
+["Utilisateur n'est pas valide"]

Associated revisions

Revision 17867
Added by Go MAEDA 8 months ago

TimeEntryTest#test_create_should_validate_user_id occasionally fails (#30806).

Patch by Go MAEDA.

History

#1 Updated by Go MAEDA 8 months ago

  • Target version set to 4.1.0

Here is a fix.

diff --git a/test/unit/time_entry_test.rb b/test/unit/time_entry_test.rb
index b67f9f884..be115a81c 100644
--- a/test/unit/time_entry_test.rb
+++ b/test/unit/time_entry_test.rb
@@ -236,6 +236,7 @@ class TimeEntryTest < ActiveSupport::TestCase
   end

   def test_create_should_validate_user_id
+    set_language_if_valid 'en'
     entry = TimeEntry.new(:spent_on => '2010-01-01',
                           :hours    => 10,
                           :project_id => 1,

#2 Updated by Go MAEDA 8 months ago

  • Status changed from New to Closed
  • Assignee set to Go MAEDA
  • Resolution set to Fixed

Committed.

Also available in: Atom PDF