Patch #36347

Add missing fixture to IssuesHelperTest

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

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

0%

Category:Code cleanup/refactoring
Target version:5.0.0

Description

IssuesHelperTest has failed. If you run the commands (rake db:migrate:reset, the test with seed value) in the following order, the test will always fail.

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

% RAILS_ENV=test bundle exec rake test TESTOPTS="--seed 57576" 
(Test LDAP server not configured)
Bazaar non ASCII output test cannot run on this environment.
Encoding.locale_charmap: UTF-8
Skipping LDAP tests.
Run options: --seed 57576

# Running:

.....F

Failure:
IssuesHelperTest#test_render_relations_stats [test/helpers/issues_helper_test.rb:435]:
"<a href="/issues?issue_id=16%2C17&amp;set_filter=true&amp;status_id=o">1 open</a>" not found in "<span class="issues-stat"><span class="badge badge-issues-count"><a href="/issues?issue_id=16%2C17&amp;set_filter=true&amp;status_id=%2A">2</a></span> (<span class="open"><a href="/issues?issue_id=16%2C17&amp;set_filter=true&amp;status_id=o">2 open</a></span> &#8212; <span class="closed">0 closed</span>)</span>" 

rails test test/helpers/issues_helper_test.rb:421

...............F

Failure:
IssuesHelperTest#test_render_descendants_stats [test/helpers/issues_helper_test.rb:417]:
"<a href="/issues?parent_id=~15&amp;set_filter=true&amp;status_id=o">1 open</a>" not found in "<span class="issues-stat"><span class="badge badge-issues-count"><a href="/issues?parent_id=~15&amp;set_filter=true&amp;status_id=%2A">2</a></span> (<span class="open"><a href="/issues?parent_id=~15&amp;set_filter=true&amp;status_id=o">2 open</a></span> &#8212; <span class="closed">0 closed</span>)</span>" 

rails test test/helpers/issues_helper_test.rb:409

..........

36347.patch Magnifier (491 Bytes) Yuichi HARADA, 2021-12-22 07:28

Associated revisions

Revision 21320
Added by Go MAEDA about 1 month ago

Add missing fixture to IssuesHelperTest (#36347).

Patch by Yuichi HARADA.

History

#1 Updated by Yuichi HARADA about 1 month ago

The cause was an insufficient fixture. The following patch will solve the issue.

diff --git a/test/helpers/issues_helper_test.rb b/test/helpers/issues_helper_test.rb
index 0b3325ad77..974e30ac62 100644
--- a/test/helpers/issues_helper_test.rb
+++ b/test/helpers/issues_helper_test.rb
@@ -34,7 +34,7 @@ class IssuesHelperTest < Redmine::HelperTest
            :enabled_modules,
            :custom_fields,
            :attachments,
-           :versions
+           :versions, :workflows

   def test_issue_heading
     assert_equal "Bug #1", issue_heading(Issue.find(1))

#2 Updated by Go MAEDA about 1 month ago

  • Target version set to 5.0.0

Confirmed the issue. Setting the target version to 5.0.0.

$ RAILS_ENV=test bin/rake db:reset
Dropped database 'db/test.sqlite3'
Created database 'db/test.sqlite3'
$ bin/rails test test/helpers/issues_helper_test.rb:421
Run options: --seed 9426

# Running:

F

Failure:
IssuesHelperTest#test_render_relations_stats [/Users/maeda/redmines/redmine-trunk/test/helpers/issues_helper_test.rb:435]:
"<a href="/issues?issue_id=16%2C17&amp;set_filter=true&amp;status_id=o">1 open</a>" not found in "<span class="issues-stat"><span class="badge badge-issues-count"><a href="/issues?issue_id=16%2C17&amp;set_filter=true&amp;status_id=%2A">2</a></span> (<span class="open"><a href="/issues?issue_id=16%2C17&amp;set_filter=true&amp;status_id=o">2 open</a></span> &#8212; <span class="closed">0 closed</span>)</span>" 

rails test test/helpers/issues_helper_test.rb:421

Finished in 2.816515s, 0.3550 runs/s, 0.7101 assertions/s.
1 runs, 2 assertions, 1 failures, 0 errors, 0 skips

#3 Updated by Go MAEDA about 1 month ago

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

Committed the fix. Thank you.

Also available in: Atom PDF