George Armhold
George Armhold

Reputation: 31064

MiniTest: how to get all elements in a fixture

Instead of returning a single User via users(:id), is there a way to get all of the users defined in users.yml?

In rspec this seems to be users(:all), but that just looks for a user with id == all in Minitest.

Upvotes: 1

Views: 381

Answers (1)

blowmage
blowmage

Reputation: 8974

If you haven't created any additional users in your test, you can simply call the following:

User.all

Upvotes: 1

Related Questions