Re: [rspec-users] Nested attributes in fixtures

2010-10-29 Thread David Chelimsky
On Oct 29, 2010, at 2:41 PM, Mack T. wrote: > By "fixtures outside Rspec", I was referring to files in our db/fixtures > directory, which I assumed were fixtures. On further investigation, I > found these files are actually being used by some custom 'seeding' code > a coworker of mine wrote.

Re: [rspec-users] Nested attributes in fixtures

2010-10-29 Thread Mack T.
By "fixtures outside Rspec", I was referring to files in our db/fixtures directory, which I assumed were fixtures. On further investigation, I found these files are actually being used by some custom 'seeding' code a coworker of mine wrote. The seeding is reading the fixtures and creating AR

Re: [rspec-users] Nested attributes in fixtures

2010-10-28 Thread David Chelimsky
On Oct 28, 2010, at 3:25 PM, Mack T. wrote: > Figured this out. Our fixtures outside Rspec are actually being used to > create instances of ActiveRecord models. AR supports > accepts_nested_attributes_for, but the Rspec fixtures bypass AR and > simply attempt to set database values. There are n

Re: [rspec-users] Nested attributes in fixtures

2010-10-28 Thread Mack T.
Figured this out. Our fixtures outside Rspec are actually being used to create instances of ActiveRecord models. AR supports accepts_nested_attributes_for, but the Rspec fixtures bypass AR and simply attempt to set database values. -- Posted via http://www.ruby-forum.com/. _

Re: [rspec-users] Nested attributes in fixtures

2010-10-28 Thread David Chelimsky
On Wed, Oct 27, 2010 at 6:30 PM, Mack T. wrote: > I appreciate the quick response!  Sorry for the delay.  The relevant > code is attached.  Our model's name is Scale, which has_many > ScaleElements. > > We're loading fixtures in specs with config.fixture_path = > "#{::Rails.root}/spec/fixtures" >

Re: [rspec-users] Nested attributes in fixtures

2010-10-27 Thread Mack T.
I appreciate the quick response! Sorry for the delay. The relevant code is attached. Our model's name is Scale, which has_many ScaleElements. We're loading fixtures in specs with config.fixture_path = "#{::Rails.root}/spec/fixtures" Nested attributes don't work (although they do outside of

Re: [rspec-users] Nested attributes in fixtures

2010-10-11 Thread David Chelimsky
On Mon, Oct 11, 2010 at 12:05 PM, Mack 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 "_attributes) when running > tests with the same fixtures. > > I am able to get th

[rspec-users] Nested attributes in fixtures

2010-10-11 Thread Mack
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 "_attributes) when running tests with the same fixtures. I am able to get the specs to run by creating a separate fixture for the nest