You are trying to test a lot of things at the same time, which is one of the reasons that it is now hard to diagnose a problem.
I would tackle this by
a) writing a separate spec for the partial _question_for_candidate
b) write a separate spec for the helper that renders the question
b) in the view spec for /survey/show use should_receive to determine
that the helper is actually being called
c) not use any fixtures in the view specs but instead use mocks for
that: it's faster and you can check exactly what needs to happen instead
of relying on what happens to be in the fixture.
I'm afraid that I don't see immediately why your current setup won't
work, but untangling things along the lines sketched above should
hopefully get you to a situation where it becomes easier to see what
happens.
> before(:each) do
> assigns[:configurations] = {:survey_name => 'Whatever'}
> assigns[:questions] = Array.new
> assigns[:questions][4] = questions(:faixa_etaria)
I am a little bit suspicious about this construction, though. I'm not
sure whether assigns is a normal Array in this case, so I'd create the
Array and populate it before handing it to assigns:
@questions = Array.new
@questions[4] = ...
assigns[:questions] = @questions
Kind regards,
Hans
signature.asc
Description: This is a digitally signed message part
_______________________________________________ rspec-users mailing list [email protected] http://rubyforge.org/mailman/listinfo/rspec-users
