devict / votelocal

A web app for receiving local voting information via SMS
15 stars 16 forks source link

Tests! We need some tests #16

Closed sethetter closed 4 years ago

sethetter commented 6 years ago

I think doing primarily HTTP feature tests would be great, if nothing else, on the TwilioController smsReceive method -> https://laravel.com/docs/5.6/http-tests

imacrayon commented 6 years ago

I'll jump on this if you haven't started yet

sethetter commented 6 years ago

@imacrayon I have! But there's more coverage we could use. The main thing is testing scheduled messages being sent at the right time to the right people. I have subscribe/unsubscribe tests and admin creating scheduled messages so far.

sethetter commented 6 years ago

@imacrayon I merged and pushed what I had so far. I'd be curious to hear if the patterns I followed here are what you might recommend, I think you spend more time in Laravel than I do :)

imacrayon commented 6 years ago

@sethetter Usually I'll add a few tests to make sure that normal users or unauthenticated users can't access admin pages/routes but other than that your approach is really close to mine. I have a few helper methods I like to add to my projects just to simplify the redundant stuff like signing in a user and creating models, I'll show you in #19.

sethetter commented 4 years ago

I'm going to close this issue out and open a new one to capture some feature testing that needs covered now with all our new functionality in place. It's a shame when tests come after the features, but it is what it is :)