rspec-rails-examples icon indicating copy to clipboard operation
rspec-rails-examples copied to clipboard

Complete test coverage for Devise-related functionality

Open eliotsykes opened this issue 10 years ago • 3 comments

Complete test coverage for Devise-related functionality:

TODO

  • unlock user
  • change password
  • forgot/reset password (click link on sign in page)
  • cancel registration? (there's a route for it)
  • resend confirmation instructions (click link on sign in page)
  • didn't receive unlock email (click link on sign in page)

DONE

  • sign in
  • sign out
  • register (happy path)
  • register (unhappy paths)
  • lock user

eliotsykes avatar Jan 03 '15 19:01 eliotsykes

Isn't this a bit redundant though? Doesn't Devise itself already test all this? I think testing Rails authentication from scratch would be a much better learning experience. And you may be able to keep it simple that way and not have to implement and test all the "cancel registration" and "resend confirmation", etc.

leesmith avatar Jun 11 '15 19:06 leesmith

@leesmith Devise is used by my students for most of their projects and is one of the main reasons why I've opted for it here.

To answer if this is redundant, as Devise does some of its own testing.

As it is reasonable to assume that a developer may accidentally write/delete/edit some code in this app to break the registration and sign-in functionality, then its a good idea to write test coverage as a safety net.

If there's no test coverage, and a developer accidentally breaks sign-in & registration, then we'll not find out there's a problem as soon as we could have.

This becomes more important if registering new users and signing them in affected the profits of a business dependent on a Devise-using app.

eliotsykes avatar Jun 14 '15 16:06 eliotsykes

That makes sense...I didn't realize this project was used for students. Great work! :+1:

leesmith avatar Jun 15 '15 14:06 leesmith