Open maelle opened 4 years ago
@daveparr I'd be curious to hear your thoughts, I see that at the moment you don't test the new post content either in dev.to.ol. :slightly_smiling_face:
Not yet, but that's basically just due to lazyness with side-projects 😛
I will in the nearish future, on the face of it I haven't spotted a reason I can't with my current workflow and vcr recording methods. Have you spotted a problem I haven't?
No I haven't spotted any problem but I was wondering how "unit" our unit tests are if we only test that the API returns no error, e.g. should we test the post that the website has is correct somehow.
It might be useless!
So in my case, I get in the response body a json string in that string (after parsing I think), I get an item called body_html
which contains what I understand to be the html that will displayed by dev.to. I was at least just initially planning on checking that it was there and not empty :)
For reference on testing https://books.ropensci.org/http-testing/
@maelle Looks like a great resource!
7 adds one test, with no auth required thanks to vcr + my trick from rredlist tests.
Now,
I cannot test media upload with vcr cf https://github.com/ropensci/vcr/issues/134 and #8
the test is not very unit-y. It might make sense to test
.wp_post
instead and look at the response body for instance.