Displaying 1 result from an estimated 1 matches for "first_answ".
Did you mean:
first_answer
2006 Mar 08
0
Unit tests dynamic finders
...d_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:
id: 1
question_id: 1
question_test.rb:
class QuestionTest < Test::Unit::TestCase
fixtures :categories, :questions, :answers
def test_destroy
question = questions(:first)
id = question.id
question.destroy
assert_raise(ActiveRecord::RecordNotFound)...