プロジェクト

全般

プロフィール

Vote #79349

完了

Unreachable code in QueriesControllerTest#test_bulk_copy_to_another_project

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

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

0%

予定工数:
category_id:
30
version_id:
99
issue_org_id:
28931
author_id:
123153
assigned_to_id:
332
comments:
6
status_id:
5
tracker_id:
1
plus1:
0
affected_version:
closed_on:
affected_version_id:
ステータス-->[Closed]

説明

this test probably never acually worked

Issue.order('id DESC').limit(issues.size)

issues.size was zero in rails < 5.2, it tests nothing

after this change it fails
https://github.com/rails/rails/commit/06f45435da941d713afefd3140421d1ced7abbdc

so I removed it


journals

--------------------------------------------------------------------------------
I think it is better to modify the test to work rather than simply deleting it.

<pre><code class="diff">
Index: test/functional/issues_controller_test.rb
===================================================================
--- test/functional/issues_controller_test.rb (revision 17367)
+++ test/functional/issues_controller_test.rb (working copy)
@@ -5967,10 +5967,11 @@

def test_bulk_copy_to_another_project
@request.session[:user_id] = 2
- assert_difference 'Issue.count', 2 do
+ issue_ids = [1, 2]
+ assert_difference 'Issue.count', issue_ids.size do
assert_no_difference 'Project.find(1).issues.count' do
post :bulk_update, :params => {
- :ids => [1, 2],
+ :ids => issue_ids,
:issue => {
:project_id => '2'
},
@@ -5980,7 +5981,7 @@
end
assert_redirected_to '/projects/ecookbook/issues'

- copies = Issue.order('id DESC').limit(issues.size)
+ copies = Issue.order('id DESC').limit(issue_ids.size)
copies.each do |copy|
assert_equal 2, copy.project_id
end
</code></pre>
--------------------------------------------------------------------------------
Committed in r17372. Thank you for reporting this issue.
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------

--------------------------------------------------------------------------------

--------------------------------------------------------------------------------


related_issues

relates,Closed,23630,Migrate to Rails 5.2

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

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

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

いいね!0
いいね!0