-1

please give any link for tutorial for controllers testing with rspec, how to start I am not able to do, I am the beginner in testing, here is the code of controller:

  def login
    if admin_logged_in?
      flash[:notice]="You are already logged in"
      redirect_to( "/admin/")
    else
      render(:layout => "admin")
    end
  end

how to test for this method.

1

1 Answer 1

0

check this two links: a Style Guide on testing https://github.com/bbatsov/rails-style-guide#controllers-1 and this screencast http://railscasts.com/episodes/71-testing-controllers-with-rspec

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.