sentinel icon indicating copy to clipboard operation
sentinel copied to clipboard

Question: Feature testing with Wallaby and ExMachina

Open cubeguerrero opened this issue 7 years ago • 2 comments

Good day,

I'm trying Sentinel out (works great!). Anyway, what's the best way to created logged in users when doing controller tests, feature tests?

cubeguerrero avatar Jul 12 '17 13:07 cubeguerrero

@cubeguerrero - This is something I'd like to add a better way to handle in the future, but for now the best example I've got is the way I'm currently handling it in the existing tests, which isn't exactly pretty.

An example of that can be found here: https://github.com/britton-jb/sentinel/blob/master/test/controllers/html/account_controller_test.exs#L21

I haven't personally worked with Wallaby yet, it's on my list of things to do, so I can't speak to that exactly, but I'd imagine it would look similar.

britton-jb avatar Jul 13 '17 13:07 britton-jb

@britton-jb thanks for getting back. Yeah, currently, that's what we did also. I basically copied your factory file and use that on our tests. We would love to help out with this, once we build/do something better, I'll post it here.

cubeguerrero avatar Jul 14 '17 02:07 cubeguerrero