# How to get the labels of entries in a fixture

**URL:** <https://www.ruby-forum.com/t/how-to-get-the-labels-of-entries-in-a-fixture/124599>\
**Category:** Rails\
**Created:** [December 30, 2007, 9:51pm UTC](https://www.ruby-forum.com/t/how-to-get-the-labels-of-entries-in-a-fixture/124599 "2007-12-30T21:51:22Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Armin\_J](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/f14d63/32.png) [@Armin\_J](https://www.ruby-forum.com/u/Armin_J)\
**Post date:** [December 30, 2007, 9:51pm UTC](https://www.ruby-forum.com/t/how-to-get-the-labels-of-entries-in-a-fixture/124599/1 "2007-12-30T21:51:22Z")

</div>

Hello,

I use in tests fixtures, you know these wonderful YAML files for  
seeding the database. When you have a database table :items then there  
is in the corresponding YAML file items.yml before each item its  
label, so you can access the item by items(:label) in your tests.

How can I get all the labels (not the items) more elegantly than  
parsing the YAML file?

Thanks in advance,

Armin
