プロジェクト

全般

プロフィール

Vote #80658

完了

Add missing fixtures to AttachmentsControllerTest

Admin Redmine さんが約4年前に追加. 約4年前に更新.

ステータス:
Closed
優先度:
通常
担当者:
-
カテゴリ:
Code cleanup/refactoring_30
対象バージョン:
開始日:
2022/05/09
期日:
進捗率:

0%

予定工数:
category_id:
30
version_id:
152
issue_org_id:
32929
author_id:
362529
assigned_to_id:
332
comments:
2
status_id:
5
tracker_id:
3
plus1:
0
affected_version:
closed_on:
affected_version_id:
ステータス-->[Closed]

説明

AttachmentsControllerTest has failed.

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

$ RAILS_ENV=test bundle exec rake test TEST=test/functional/attachments_controller_test.rb
Run options: --seed 55811

# Running:

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

Error:
AttachmentsControllerTest#test_destroy_issue_attachment:
NoMethodError: undefined method `high?' for nil:NilClass
    app/models/issue.rb:1045:in `notified_users'
    app/models/journal.rb:147:in `notified_users'
    app/models/mailer.rb:130:in `deliver_issue_edit'
    app/models/journal.rb:322:in `send_notification'
    app/controllers/attachments_controller.rb:156:in `destroy'
    lib/redmine/sudo_mode.rb:64:in `sudo_mode'
    test/functional/attachments_controller_test.rb:586:in `block (2 levels) in test_destroy_issue_attachment'
    test/functional/attachments_controller_test.rb:585:in `block in test_destroy_issue_attachment'
    test/functional/attachments_controller_test.rb:584:in `test_destroy_issue_attachment'


bin/rails test test/functional/attachments_controller_test.rb:580

.........

Finished in 2.985696s, 16.0767 runs/s, 48.5649 assertions/s.
48 runs, 145 assertions, 0 failures, 1 errors, 0 skips

I think that because the fixtures not enough.


diff --git a/test/functional/attachments_controller_test.rb b/test/functional/attachments_controller_test.rb
index a3442f6a3..bf889892d 100644
--- a/test/functional/attachments_controller_test.rb
+++ b/test/functional/attachments_controller_test.rb
@@ -20,9 +20,9 @@
 require File.expand_path('../../test_helper', __FILE__)

 class AttachmentsControllerTest < Redmine::ControllerTest
-  fixtures :users, :projects, :roles, :members, :member_roles,
+  fixtures :users, :user_preferences, :projects, :roles, :members, :member_roles,
            :enabled_modules, :issues, :trackers, :attachments,
-           :versions, :wiki_pages, :wikis, :documents
+           :versions, :wiki_pages, :wikis, :documents, :enumerations

   def setup
     User.current = nil

journals

--------------------------------------------------------------------------------
Committed the patch. Thank you.
--------------------------------------------------------------------------------

Admin Redmine さんが約4年前に更新

  • カテゴリCode cleanup/refactoring_30 にセット
  • 対象バージョン4.2.0_152 にセット

他の形式にエクスポート: Atom PDF

いいね!0
いいね!0