Patch #32478

Add missing fixture to TimelogControllerTest

Added by Yuichi HARADA 2 months ago. Updated about 1 month ago.

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

0%

Category:Code cleanup/refactoring
Target version:-

Description

TimelogControllerTest has failed.

$ RAILS_ENV=test bundle exec rake db:migrate:reset

$ RAILS_ENV=test bundle exec rake test TEST=test/functional/timelog_controller_test.rb
Run options: --seed 44668

# Running:

............................................E

Error:
TimelogControllerTest#test_index_with_issue_fixed_version_sort:
ActiveRecord::RecordNotFound: Couldn't find Version with 'id'=3
    test/functional/timelog_controller_test.rb:1249:in `test_index_with_issue_fixed_version_sort'

bin/rails test test/functional/timelog_controller_test.rb:1247

E

Error:
TimelogControllerTest#test_index_with_issue_fixed_version_column:
ActiveRecord::RecordNotFound: Couldn't find Version with 'id'=3
    test/functional/timelog_controller_test.rb:1198:in `test_index_with_issue_fixed_version_column'

bin/rails test test/functional/timelog_controller_test.rb:1196

........................................S................

Finished in 6.986126s, 14.7435 runs/s, 44.3737 assertions/s.
103 runs, 310 assertions, 0 failures, 2 errors, 1 skips

You have skipped tests. Run with --verbose for details.

I think that because the fixtures not enough.

diff --git a/test/functional/timelog_controller_test.rb b/test/functional/timelog_controller_test.rb
index 9c0b958b9..862fc226d 100644
--- a/test/functional/timelog_controller_test.rb
+++ b/test/functional/timelog_controller_test.rb
@@ -25,7 +25,7 @@ class TimelogControllerTest < Redmine::ControllerTest
            :trackers, :enumerations, :issue_statuses,
            :custom_fields, :custom_values,
            :projects_trackers, :custom_fields_trackers,
-           :custom_fields_projects, :issue_categories
+           :custom_fields_projects, :issue_categories, :versions

   include Redmine::I18n


Related issues

Related to Redmine - Feature #30346: Add "Target Version" to the list of "Available columns" i... Closed

Associated revisions

Revision 19088
Added by Go MAEDA 2 months ago

Add missing fixture to TimelogControllerTest in order to fix random test failure (#32478).

Patch by Yuichi HARADA.

Revision 19330
Added by Go MAEDA about 1 month ago

Merged r19088 from trunk to 4.1-stable (#32478, #30346).

History

#1 Updated by Yuichi HARADA 2 months ago

  • Copied from Patch #32444: Add missing fixture to Redmine::WikiFormatting::MacrosTest added

#2 Updated by Go MAEDA 2 months ago

  • Copied from deleted (Patch #32444: Add missing fixture to Redmine::WikiFormatting::MacrosTest)

#3 Updated by Go MAEDA 2 months ago

  • Status changed from New to Closed

Committed the patch. Thank you.

#4 Updated by Go MAEDA 2 months ago

  • Related to Feature #30346: Add "Target Version" to the list of "Available columns" in "Spent time" Tab added

#5 Updated by Go MAEDA about 1 month ago

  • Target version deleted (4.2.0)

Cleared the target version because the fix is a part of #30346.

Also available in: Atom PDF