Patch #32540

Add missing fixtures to VersionTest

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

Status:ClosedStart date:
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:Code cleanup/refactoring
Target version:-

Description

VersionTest has failed.

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

$ RAILS_ENV=test bundle exec rake test TEST=test/unit/version_test.rb
Run options: --seed 60229

# Running:

.E

Error:
VersionTest#test_safe_attributes_should_include_only_custom_fields_visible_to_user:
ActiveRecord::RecordNotFound: Couldn't find Role with 'id'=[3]
    test/unit/version_test.rb:306:in `test_safe_attributes_should_include_only_custom_fields_visible_to_user'

bin/rails test test/unit/version_test.rb:302

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

Finished in 1.878556s, 16.5020 runs/s, 32.4717 assertions/s.
31 runs, 61 assertions, 0 failures, 1 errors, 0 skips
$

I think that because the fixtures not enough.

diff --git a/test/unit/version_test.rb b/test/unit/version_test.rb
index a467a09db..113491202 100644
--- a/test/unit/version_test.rb
+++ b/test/unit/version_test.rb
@@ -22,7 +22,8 @@ require File.expand_path('../../test_helper', __FILE__)
 class VersionTest < ActiveSupport::TestCase
   fixtures :projects, :users, :issues, :issue_statuses, :trackers,
            :enumerations, :versions, :projects_trackers,
-           :custom_fields, :custom_fields_trackers, :custom_fields_projects
+           :custom_fields, :custom_fields_trackers, :custom_fields_projects,
+           :members, :member_roles, :roles

   def setup
     User.current = nil

Associated revisions

Revision 19327
Added by Go MAEDA 4 months ago

Add missing fixtures to VersionTest (#32540).

Patch by Yuichi HARADA.

Revision 19328
Added by Go MAEDA 4 months ago

Merged r19327 from trunk to 4.1-stable ( #32540, #31954, #23997).

History

#1 Updated by Go MAEDA 4 months ago

  • Status changed from New to Closed
  • Target version set to 4.2.0

Committed the fix. Thank you for your contribution.

#2 Updated by Go MAEDA 4 months ago

  • Target version deleted (4.2.0)

Cleared the target version because the fix is a part of #31954 and #23997.

Also available in: Atom PDF