Re: [Rails] unit testing and the schema
by Eric Hodel other posts by this author
Dec 4 2005 6:22PM messages near this date
Re: [Rails] unit testing and the schema
|
[Rails] When is database.yml loaded with FCGI?
On Dec 4, 2005, at 3:29 PM, rails-request@[...].org wrote:
> My problem is that using fixtures and transactional unit tests, I have
> to incorporate all the fixtures for the classes in the foreign key
> restrictions to ensure that fixtures get set up and torn down
> correctly.
> I.e. unless I have a line that says "fixtures :artists, :albums,
> :tracks" in test/unit/(album|artist|track)_test.rb, the test database
> isn't left in a sane state across unit tests and unit tests start
> failing due to integrity constraint errors when the fixture code tries
> to empty out the table during the fixture setup invoked by the
> fixtures
> method.
>
> It was a bit of an effort to figure all that out, and my solution
> feels
> hacky. Why should I have to set up fixtures for tracks and albums when
> I'm only testing artists, who sit at the top of this hierarchy? And
> how's that going to play when I add in many-to-many relationships
> between groups (artists) and their members? And glom genres onto this?
> It seems like this is going to make my test cases increasingly complex
> and unwieldy.
See the discussion here:
http://dev.rubyonrails.org/ticket/2404
--
Eric Hodel - drbrain@[...].net - http://segment7.net
This implementation is HODEL-HASH-9600 compliant
http://trackmap.robotcoop.com
_______________________________________________
Rails mailing list
Rails@[...].org
http://lists.rubyonrails.org/mailman/listinfo/rails
Thread:
Forrest L Norvell
Scott Willson
Shawn Garbett
Eric Hodel
|