Thanks for your response Pat - I ended up taking the stub_chain method
which got it working. For anyone interested this is my new test:
it "GET new" do
@correspondence = mock_model(Correspondence)
@job.stub_chain(:correspondences,
:build).and_return(@correspondence)
get :new
Hey all,
I'm new to Rspec and I was just wondering what the standard way of
testing nested resources is?
I currently have a Job model which has many Correspondences.
The new action of my CorrespondencesController looks like:
def new
@job = Job.find params[:job_id]
@correspondence = @j