I have the following line in my action of creating my controller teacher.
@rating = @teacher.ratings.build(params[:rating]) unless params[:rating][:rating].blank?
I know that my associations are true, because this line correctly creates a new rating along with a new teacher, if the rating does not remain empty. However, I try to follow TDD, and I don't know how to check this line with rspec. I was a little confused.
I use a factory girl and should, if that helps.
James source
share