Add fixture use case to testing.md.
I think people would find it useful to know that you can pass in multiple fixture names to get an array of all the fixtures. I've found this useful in my own app. It looks like there already a test case that supports this feature (https://github.com/rails/rails/blob/master/activerecord/test/cases/fixtures_test.rb#L398), but it's just not documented here. I look forward to your feedback!
This commit is contained in:
parent
335a2b8a40
commit
3862c55049
@ -141,6 +141,13 @@ users(:david).id
|
||||
email(david.partner.email, david.location_tonight)
|
||||
```
|
||||
|
||||
To get multiple fixtures at once, you can pass in a list of fixture names. For example:
|
||||
|
||||
```ruby
|
||||
# this will return an array containing the fixtures david and steve
|
||||
users(:david, :steve)
|
||||
```
|
||||
|
||||
### Console Tasks for Running your Tests
|
||||
|
||||
Rails comes with a CLI command to run tests.
|
||||
|
Loading…
Reference in New Issue
Block a user