Ruby on Rails Monday, November 17, 2014



On Friday, November 14, 2014 7:22:41 PM UTC, Kyle Fazzari wrote:
How then do we write tests for the `Post` model if the engine doesn't contain a model for the author? I'm using FactoryGirl and I tried just putting together a factory for a user, but it doesn't work without a corresponding table. I suppose I could create a basic `Author` class within the generated `test/dummy` application, but then all the tests would have to be put in there as well, which feels a little nasty to me (I just want my tests in an obvious place, I guess). I think a solution is probably outside of the testing setup being used (rspec, minitest, fixtures or factories, etc.).

I feel like this is a fairly typical use for an engine, so I thought maybe some of you had run into this issue before. I appreciate any help!


I've done this by just adding my author class equivalent in test/dummy. You don't have to also put the tests in there though

Fred 

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/eabcec56-71ed-4a33-b839-d1e19541fde7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment