I am trying to test the new action in my controller. At the moment it looks like this:
Controller
def new
@business = Business.new
@business.addresses.build
end
Spec
describe 'GET #new' do
it 'assigns a new business to @business' do
get :new
expect(assigns(:business)).to be_a_new(Business)
end
end
I would like to test the line '@business.addresses.build'. How do I do this?
Thanks in advance!
@business.addressesstackoverflow.com/questions/6084346/… - Stepan Zakharov