Patch #31705

Add missing fixtures to AttachmentFormatVisibilityTest

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

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

0%

Category:Code cleanup/refactoring
Target version:4.1.0

Description

The test has failed.
https://www.redmine.org/builds/logs/build_trunk_sqlite3_ruby-2.6_456.html

E

Error:
AttachmentFormatVisibilityTest#test_attachment_should_be_visible_with_visible_custom_field:
ActiveRecord::RecordNotUnique: SQLite3::ConstraintException: UNIQUE constraint failed: custom_fields_trackers.custom_field_id, custom_fields_trackers.tracker_id: INSERT INTO "custom_fields_trackers" ("custom_field_id", "tracker_id") VALUES (?, ?)
    test/object_helpers.rb:204:in `generate!'
    test/object_helpers.rb:209:in `generate!'
    test/unit/lib/redmine/field_format/attachment_format_visibility_test.rb:36:in `test_attachment_should_be_visible_with_visible_custom_field'

bin/rails test test/unit/lib/redmine/field_format/attachment_format_visibility_test.rb:35

E

Error:
AttachmentFormatVisibilityTest#test_attachment_should_be_visible_with_limited_visibility_custom_field:
ActiveRecord::RecordNotUnique: SQLite3::ConstraintException: UNIQUE constraint failed: custom_fields_trackers.custom_field_id, custom_fields_trackers.tracker_id: INSERT INTO "custom_fields_trackers" ("custom_field_id", "tracker_id") VALUES (?, ?)
    test/object_helpers.rb:204:in `generate!'
    test/object_helpers.rb:209:in `generate!'
    test/unit/lib/redmine/field_format/attachment_format_visibility_test.rb:50:in `test_attachment_should_be_visible_with_limited_visibility_custom_field'

bin/rails test test/unit/lib/redmine/field_format/attachment_format_visibility_test.rb:49

I think that because the fixtures is not enough.

diff --git a/test/unit/lib/redmine/field_format/attachment_format_visibility_test.rb b/test/unit/lib/redmine/field_format/attachment_format_visibility_test.rb
index b648ac11f..c9fee583a 100644
--- a/test/unit/lib/redmine/field_format/attachment_format_visibility_test.rb
+++ b/test/unit/lib/redmine/field_format/attachment_format_visibility_test.rb
@@ -25,6 +25,7 @@ class AttachmentFormatVisibilityTest < ActionView::TestCase
            :roles, :members, :member_roles,
            :users, :email_addresses,
            :trackers, :issue_statuses, :enumerations, :issue_categories,
+           :custom_fields, :custom_fields_trackers,
            :versions, :issues

   def setup

Associated revisions

Revision 18327
Added by Go MAEDA 5 months ago

Add missing fixtures in AttachmentFormatVisibilityTest (#31705).

Patch by Yuichi HARADA.

History

#1 Updated by Go MAEDA 5 months ago

  • Status changed from New to Closed
  • Assignee set to Go MAEDA
  • Target version set to 4.1.0

Committed the patch. Thank you.

Also available in: Atom PDF