๐ค Situation
describe 'InviteUserController', type: :controller do
describe '#edit' do
before { get :edit, token: user.token }
it 'should have user_form' do
# ๐ฆ Here ๐ฆ
expect(assigns(:user_form).class.name).to eq 'UserForm'
end
end
end
๐ Meaning
assigns relates to the instance variables created within a controller action (and assigned to the view).
So, You might have such like Controller.
class InviteUserController
def edit
# ๐ฆ this @user_form ๐ฆ
@user_form = UserForm.new(token: user_params[:token])
render :edit
end
end
Top comments (0)