On Dec 8, 2:15 pm, Ori Kremer <[email protected]> wrote:

> I understand that fixtures are guaranteed to be fully loaded only when
> my test runs, the problem is, like you said, that the model class
> validation is evaluated before that.
>
> Another approach I tried was not to use fixtures at all, since payment
> types are actually seed data and not sample data.
> That approach failed as well for the same reason that the model
> validation is called from the engine initialization which is done before
> the seed data gets populated.
>
> The question remains, how can I use validates inclusion on a lookup
> table and not fail the test (when running only integration tests).
>
why validate the inclusion at all ? I'd validate the presence of the
foo_id column and use a foreign key constraint to ensure that it can't
contain junk.

Fred

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to