aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test
diff options
context:
space:
mode:
authorRyuta Kamizono <kamipo@gmail.com>2018-10-15 11:20:05 +0900
committerRyuta Kamizono <kamipo@gmail.com>2018-10-15 12:23:19 +0900
commitecd46231ff97f6735b62543416a230390fa22b21 (patch)
treef8f6ca5d466392496626cba5523468dbfb7afbf0 /activerecord/test
parentbc2a77ab2704e7b90920fff6e077e42ddcfff73b (diff)
downloadrails-ecd46231ff97f6735b62543416a230390fa22b21.tar.gz
rails-ecd46231ff97f6735b62543416a230390fa22b21.tar.bz2
rails-ecd46231ff97f6735b62543416a230390fa22b21.zip
Ensure to test that `project.developers` is ordered by `developers.name desc`
`developers.name desc` was added at d59f3a7, but any test case isn't failed even if the `developers.name desc` is removed since all tested developers are consistently ordered on both `name` and `id`. I changed one developers creation ordering to ensure to test that `project.developers` is ordered by `developers.name desc`.
Diffstat (limited to 'activerecord/test')
-rw-r--r--activerecord/test/cases/associations/has_and_belongs_to_many_associations_test.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/test/cases/associations/has_and_belongs_to_many_associations_test.rb b/activerecord/test/cases/associations/has_and_belongs_to_many_associations_test.rb
index 38b121d37b..ed7dde115a 100644
--- a/activerecord/test/cases/associations/has_and_belongs_to_many_associations_test.rb
+++ b/activerecord/test/cases/associations/has_and_belongs_to_many_associations_test.rb
@@ -275,7 +275,7 @@ class HasAndBelongsToManyAssociationsTest < ActiveRecord::TestCase
def test_habtm_saving_multiple_relationships
new_project = Project.new("name" => "Grimetime")
amount_of_developers = 4
- developers = (0...amount_of_developers).collect { |i| Developer.create(name: "JME #{i}") }.reverse
+ developers = (0...amount_of_developers).reverse_each.map { |i| Developer.create(name: "JME #{i}") }
new_project.developer_ids = [developers[0].id, developers[1].id]
new_project.developers_with_callback_ids = [developers[2].id, developers[3].id]