Patch #31966

Add missing fixtures to Redmine::Helpers::GanttHelperTest

Added by Yuichi HARADA 3 months ago. Updated 3 months ago.

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

0%

Category:Code cleanup/refactoring
Target version:4.1.0

Description

Redmine::Helpers::GanttHelperTest has failed.

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

$ RAILS_ENV=test bundle exec rake test TEST=test/unit/lib/redmine/helpers/gantt_test.rb
Run options: --seed 57961

# Running:

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

Error:
Redmine::Helpers::GanttHelperTest#test_#column_content_for_issue:
ActiveRecord::RecordInvalid: Validation failed: Tracker cannot be blank, Status cannot be blank
    test/object_helpers.rb:107:in `generate!'
    test/unit/lib/redmine/helpers/gantt_test.rb:457:in `block in <class:GanttHelperTest>'

bin/rails test test/unit/lib/redmine/helpers/gantt_test.rb:454

.......E

Error:
Redmine::Helpers::GanttHelperTest#test_#selected_column_content:
ActiveRecord::RecordInvalid: Validation failed: Tracker cannot be blank, Status cannot be blank
    test/object_helpers.rb:107:in `generate!'
    test/unit/lib/redmine/helpers/gantt_test.rb:249:in `block in <class:GanttHelperTest>'

bin/rails test test/unit/lib/redmine/helpers/gantt_test.rb:247

.............................

Finished in 3.026629s, 16.1896 runs/s, 26.1016 assertions/s.
49 runs, 79 assertions, 0 failures, 2 errors, 0 skips

I think that because the fixtures is not enough.

diff --git a/test/unit/lib/redmine/helpers/gantt_test.rb b/test/unit/lib/redmine/helpers/gantt_test.rb
index 61de69483..1720ff6aa 100644
--- a/test/unit/lib/redmine/helpers/gantt_test.rb
+++ b/test/unit/lib/redmine/helpers/gantt_test.rb
@@ -20,7 +20,7 @@
 require File.expand_path('../../../../../test_helper', __FILE__)

 class Redmine::Helpers::GanttHelperTest < Redmine::HelperTest
-  fixtures :projects, :trackers, :issue_statuses,
+  fixtures :projects, :trackers, :projects_trackers, :issue_statuses,
            :enumerations, :users, :issue_categories

   include ProjectsHelper

Associated revisions

Revision 18408
Added by Go MAEDA 3 months ago

Add missing fixtures to Redmine::Helpers::GanttHelperTest (#31966).

Patch by Yuichi HARADA.

History

#1 Updated by Go MAEDA 3 months ago

  • Target version set to 4.1.0

#2 Updated by Go MAEDA 3 months ago

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

Committed the patch. Thank you for detecting and fixing the issue.

Also available in: Atom PDF