News for hackers. Stuff that matters.
Re:DRYing Elixir Tests with Macros by moomin on Wednesday February 17, 2016 @08:19AM (#11117615)
This observation is orthogonal to the original article but: often DRYing tests is a bad idea. Two principal reasons: 1) if you need a lot of boilerplate, you might need to look at refactoring your classes to reduce dependencies 2) non-DRY tests are often easier to read due to increased indirection.

None of which means that I don't reserve the right to DRY tests out when I think it's contextually appropriate.

Re:DRYing Elixir Tests with Macros by hugoribeira on Wednesday February 17, 2016 @09:02AM (#11117870)
I agree, you should be very careful about DRYing tests. Making sure and endpoint touches the authentication layer seems like a very good case to break that rule of thumb.

I've been writing Web Applications for a while now. There was only a handful of cases where I needed to repeat the same test case over and over again (authentication being one of them).

If it happens too often, it's a good tell that you're missing a responsability delegation into a concrete module/class somewhere.