Doveps / mono

Code for Doveps projects
http://doveps.com
MIT License
0 stars 0 forks source link

Deeper nulltestcase #123

Closed JosiahRegencia closed 6 years ago

JosiahRegencia commented 6 years ago

This is for the added feedback on issue #117 I wasn't really sure what was meant. Made this as temporary solution instead. What it does is that savant searches through the main tables in the database and looks for duplicates. Build passed in: https://travis-ci.org/Doveps/mono/builds/349770733

greenmoss commented 6 years ago

Thanks, following up with Slack conversation:

I would avoid db calls and creating special api endpoints just for the tests The api should include only end points we will need as a normal savant user At least for the “real” test If you want to reset db between tests that is totally ok, and you can use direct db calls to do that

Db calls in tests are ok if you need to reset But avoid them for generating or retrieving test results For those use only the api Try to test the same way an end user would do it For instance an end user might hit api /blah Although /blah does db stuff a user doesn’t see that User only sees api input and output So tests should do the same

If we see errors as a result of api calls we write a test to generate the same error using the same api call Then fix it and the test now passes Yeah that can be challenging It will make the api stronger

Feedback for the PR 😄