Project

General

Profile

Actions

Patch #32540

closed

Add missing fixtures to VersionTest

Added by Yuichi HARADA over 4 years ago. Updated over 4 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
Code cleanup/refactoring
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:

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
Actions #1

Updated by Go MAEDA over 4 years ago

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

Committed the fix. Thank you for your contribution.

Actions #2

Updated by Go MAEDA over 4 years ago

  • Target version deleted (4.2.0)

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

Actions

Also available in: Atom PDF