[rspec-users] Nested attributes in fixtures

David Chelimsky dchelimsky at gmail.com
Tue Oct 12 02:07:39 EDT 2010

On Mon, Oct 11, 2010 at 12:05 PM, Mack <mack.talcott at gmail.com> wrote:
> I'm unable to get nested attributes in fixtures to work with Rspec.
> The models and fixtures function fine outside of rspec, but I get a
> mysql error (Unknown column "<nested table>_attributes) when running
> tests with the same fixtures.
> I am able to get the specs to run by creating a separate fixture for
> the nested table.  Shouldn't Rspec handle nested attributes in
> fixtures, though?

The only fixture support provided by RSpec are hooks into the Rails
configuration to tell it where fixtures are stored, whether to use
instantiated fixtures, and whether to use transactions around each
example. There is no specific support for fixture loading - that all
comes from Rails.

That said, maybe we can help you, but you'll need to provide some more info:

* rspec version
* rails version
* spec code
* implementation code
* _full_ failure message

Code and failure messages are fine in email or in gists.


More information about the rspec-users mailing list