RubyFlow The Ruby and Rails community linklog

×

The Ruby and Rails community linklog

Made a library? Written a blog post? Found a useful tutorial? Share it with the Ruby community here or just enjoy what everyone else has found!

Testing authentication in Rails with Minitest

Chapter 12 of the free Minitest Rails guide is live: https://minitestrails.com/guide/testing-authentication/

Until now, the Cookbook app let anyone create, edit, and destroy recipes. This chapter catches the app up to how real apps work, while keeping the same testing habits you’ve already been using.

What this chapter adds:

  • Rails 8 generate authentication (users, sessions, sign-in, password reset)
  • Integration and system test coverage for sign in and sign out
  • Session helpers (sign_in_as for HTTP tests, sign_in_to_ui_as for the browser)
  • Read-only access for guests (browse list/show; writes redirect to sign-in)
  • Password reset request and update coverage (integration + system smoke)

Post a comment

You can use basic HTML markup (e.g. <a>) or Markdown.

As you are not logged in, you will be
directed via GitHub to signup or sign in