π€ 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)