0

I have a following after_sign_in_path_for(@user) method in the application controller and this method is protected.

  def after_sign_in_path_for(resource)
    if current_account.present?
      if current_account.role.present? && current_account.role.downcase == "admin"
        admin_dashboard_path
      elsif current_account.role.present? && current_account.role.downcase == "sales"
        sales_dashboard_path
      elsif current_account.role.present? && current_account.role.downcase == "claims"
        claims_dashboard_path
      else
        admin_dashboard_path
      end
    elsif current_partner.present?
      affiliate_dashboard_path
    elsif current_agent.present?
      agents_dashboard_path
    else
      root_path
    end      
  end

How can I write Rspec Testing for above method?

I am using Capybara for Rspec.

John Saunders
  • 160,644
  • 26
  • 247
  • 397
Dipak Panchal
  • 5,996
  • 4
  • 32
  • 68

0 Answers0