Open jaceklaskowski opened 11 years ago
I've took the opportunity to start fiddling with midje on that issue but I'm not sure if I understand it right - what one is supposed to test? When I take pure request/response check approach (as in case of existing tests), there's no distinction between login as user and login as admin when it comes to the outcome. In both cases the response is simple {:successful true}. The same with logout. Maybe what you meant is a sort of a full-blown selenium driven test?
I don't want anybody to get burried setting up a test infrastructure for the project. The tests should be as simple as possible and let us introduce changes without worrying they break the project.
The tests should've been written before writing the code, but in this particular case it's gonna be different only when the tests deserve existence. If you think the tests are not necessary, mark the issue to be closed. It was just an idea to have more tests so others could join writing tests if they think that's the way to get involved.
What do you think?
Going through history, I've realized that these tests (at least these in core) mainly conern routing, not the business logic. I'll try to look into that. I'm still struggling with proper testing (not only in clojure) so this will be an opportunity for me to do some sharpening in that aspect. Marick's way of doing TDD (as in his example tutorial on that game logic design) with Midje really feels right to me - maybe because of that strongly declarative approach.
Can't wait till I see new tests coming in. Don't let me wait too long :-)
Thought I would write some tests but I see that you're doing some cleaning up and test-related changes. Should I restrain from doing anything in that regard for now?
Do it now. I'm finished for today. Use lein2 midje --lazytest while midje'ing as it will automatically execute the tests changed. Pull request once done (I spent a couple of hours trying to squash some autorization-related test issues, but couldn't get passed a line where response is supposed to be available - it's been nil)
Just by the way (and sorry for off-topic) - "Create account" still doesn't bring up any overlay/dialog. Is that a problem awaiting for a fix or should it behave correctly by now?
Needs a fix...and more importantly a test before an implementation :-) Everything's in the repo.
Tests for the following use cases (guess they should be separate issues - create ones if you think so):