How do you handle adding something like Devise authentication in BDD stories? -


if have set of bdd scenarios like:

  • user should able register
  • user should able login
  • user should able reset password

etc., write first scenario, write code make pass, , refactor.

but if use devise, which, once correctly installed , configured, gives these features @ once, best practice that? because, if write first test , configure devise test passes, other tests write should automatically pass without having failed before. or having tests fail first not strictly necessary in bdd workflow, , should happy tests pass?

with bdd, should focus on value you're providing users or stakeholders. logging in isn't valuable, i'd give them log in for first.

then scenarios become easy, either:

given fred logged in when fred buys book... 

or

given fred on home page when fred buys book... 

logging in has no value, , apologise being 1 of people who's used bdd example in previous years. don't log in unless need to, , don't code first.

i'd write scenarios 3rd party apps if didn't trust them, @ point, yes, might fail. better use them in own valuable scenarios.


Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -