Displaying 1 result from an estimated 1 matches for "find_by_question_id".
2006 Mar 08
0
Unit tests dynamic finders
...n two models (B depends on A) deleting A should also delete B. 
This is simple with the dependent parameter in the model file of A. But 
when I write a test the dependency seems to work, I can''t find the 
answer with id 1 anymore(Answer.find(1)). But I appearently _do_ find it 
with Answer.find_by_question_id(1) or Answer.find(:first, :conditions => 
"question_id = 1"). What am I doing wrong??
Below you will find the relevant files used in testing.
questions.yml:
first_question:
  id: 1
  question: "Will fixture files work?"
  answer: "No"
answers.yml:
first_answer:...