Vote #79349
完了Unreachable code in QueriesControllerTest#test_bulk_copy_to_another_project
0%
説明
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 にセット