プロジェクト

全般

プロフィール

Vote #80845

完了

Add missing fixtures to VersionsHelperTest

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

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

0%

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

説明

VersionsHelperTest has failed.

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

$ RAILS_ENV=test bundle exec rake test TEST=test/helpers/version_helper_test.rb
Run options: --seed 60566

# Running:

E

Error:
VersionsHelperTest#test_link_to_new_issue_should_take_into_account_user_permissions_on_fixed_version_id_field:
ActiveRecord::RecordInvalid: Validation failed: Tracker cannot be blank, Old status cannot be blank
    test/helpers/version_helper_test.rb:103:in `test_link_to_new_issue_should_take_into_account_user_permissions_on_fixed_version_id_field'


bin/rails test test/helpers/version_helper_test.rb:101

.......E

Error:
VersionsHelperTest#test_link_to_new_issue_should_return_nil_if_user_does_not_have_permission_to_add_issue:
ActiveRecord::RecordNotFound: Couldn't find User with 'id'=2 [WHERE "users"."type" IN ('User', 'AnonymousUser')]
    test/helpers/version_helper_test.rb:81:in `test_link_to_new_issue_should_return_nil_if_user_does_not_have_permission_to_add_issue'


bin/rails test test/helpers/version_helper_test.rb:77

E

Error:
VersionsHelperTest#test_link_to_new_issue_should_return_link_to_add_issue:
TypeError: no implicit conversion of nil into String
    test/test_helper.rb:241:in `initialize'
    test/test_helper.rb:241:in `new'
    test/test_helper.rb:241:in `assert_select_in'
    test/helpers/version_helper_test.rb:65:in `test_link_to_new_issue_should_return_link_to_add_issue'


bin/rails test test/helpers/version_helper_test.rb:57

E

Error:
VersionsHelperTest#test_link_to_new_issue_should_return_nil_if_no_tracker_is_available_for_project:
ActiveRecord::RecordNotFound: Couldn't find User with 'id'=2 [WHERE "users"."type" IN ('User', 'AnonymousUser')]
    test/helpers/version_helper_test.rb:96:in `test_link_to_new_issue_should_return_nil_if_no_tracker_is_available_for_project'


bin/rails test test/helpers/version_helper_test.rb:86

.

Finished in 0.930490s, 12.8964 runs/s, 11.8217 assertions/s.
12 runs, 11 assertions, 0 failures, 4 errors, 0 skips
$

journals

I think that because of the fixtures are not enough.

<pre><code class="diff">
diff --git a/test/helpers/version_helper_test.rb b/test/helpers/version_helper_test.rb
index 01ecf910f..a0a16d341 100644
--- a/test/helpers/version_helper_test.rb
+++ b/test/helpers/version_helper_test.rb
@@ -22,7 +22,10 @@ require File.expand_path('../../test_helper', __FILE__)
class VersionsHelperTest < Redmine::HelperTest
include Rails.application.routes.url_helpers

- fixtures :projects, :versions
+ fixtures :projects, :versions, :enabled_modules,
+ :users, :members, :roles, :member_roles,
+ :trackers, :projects_trackers,
+ :issue_statuses

def test_version_filtered_issues_path_sharing_none
version = Version.new(:name => 'test', :sharing => 'none')
</code></pre>
--------------------------------------------------------------------------------
I have confirmed that the test fails if any of the newly added fixture by the patch is missing.

Setting the target version to 4.2.0.
--------------------------------------------------------------------------------
Committed the patch. Thank you for detecting and fixing the issue.
--------------------------------------------------------------------------------

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

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

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

いいね!0
いいね!0