プロジェクト

全般

プロフィール

Vote #81156

完了

Add missing fixtures to AttachmentsControllerTest

Admin Redmine さんが3年以上前に追加. 3年以上前に更新.

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

0%

予定工数:
category_id:
30
version_id:
152
issue_org_id:
34321
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 62032

# Running:

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

Error:
AttachmentsControllerTest#test_destroy_issue_attachment:
ActionView::Template::Error: undefined method `is_closed?' for nil:NilClass
    app/helpers/issue_statuses_helper.rb:22:in `issue_status_type_badge'
    app/views/mailer/_issue.html.erb:3:in `_app_views_mailer__issue_html_erb___4391335022488939404_70210668642100'
    app/views/mailer/issue_edit.html.erb:15:in `_app_views_mailer_issue_edit_html_erb__951082845966517113_70210668542720'
    app/models/mailer.rb:709:in `block in mail'
    app/models/mailer.rb:707:in `mail'
    app/models/mailer.rb:123:in `issue_edit'
    app/models/mailer.rb:48:in `process'
    app/models/mailer.rb:137:in `block in deliver_issue_edit'
    app/models/mailer.rb:136:in `each'
    app/models/mailer.rb:136:in `deliver_issue_edit'
    app/models/journal.rb:337:in `send_notification'
    app/controllers/attachments_controller.rb:174:in `destroy'
    lib/redmine/sudo_mode.rb:61:in `sudo_mode'
    test/functional/attachments_controller_test.rb:642:in `block (2 levels) in test_destroy_issue_attachment'
    test/functional/attachments_controller_test.rb:641:in `block in test_destroy_issue_attachment'
    test/functional/attachments_controller_test.rb:640:in `test_destroy_issue_attachment'


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

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

Finished in 3.631273s, 14.3200 runs/s, 43.2355 assertions/s.
52 runs, 157 assertions, 0 failures, 1 errors, 0 skips

journals

The cause was insufficient fixtures. The following patch solves this issue.

<pre><code class="diff">
diff --git a/test/functional/attachments_controller_test.rb b/test/functional/attachments_controller_test.rb
index 6372fb646..a557a1bd7 100644
--- a/test/functional/attachments_controller_test.rb
+++ b/test/functional/attachments_controller_test.rb
@@ -21,7 +21,7 @@ require File.expand_path('../../test_helper', __FILE__)

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

def setup
</code></pre>
--------------------------------------------------------------------------------
Committed the fix. Thank you.
--------------------------------------------------------------------------------

Admin Redmine さんが3年以上前に更新

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

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

いいね!0
いいね!0