codetriage / docs_doctor

http://docsdoctor.org
27 stars 21 forks source link

Allow sorting between no docs and docs #21

Open thenickcox opened 9 years ago

thenickcox commented 9 years ago

I was just paging through the docs for rails, and it took me an embarrassingly long time before I realized that the docs there were for every method, not just the undocumented ones. And yes, I saw the "(undocumented)" string next to the method title, but I was confused.

My use case was coming to manually find undocumented methods, because the one I received via email today stumped me. A way to filter between documented and undocumented methods would be awesome.

prathamesh-sonpatki commented 9 years ago

@thenickcox What do you mean by "(undocumented)" string next to the method title? Please show an example.

thenickcox commented 9 years ago

Sorry that wasn't clear. screen shot 2015-03-31 at 11 09 15 pm

thenickcox commented 9 years ago

@prathamesh-sonpatki Went to write a test for this, but I didn't want to introduce any new testing strategies. I thought about just wrapping it into a controller test and checking for a sorted param, using either the missing_docs or with_docs scopes on DocMethod. But I couldn't think of a way to do test these scopes without creating records and testing their inclusion or exclusion. But this would have to hit the database. Is that something you'd really like to avoid?

schneems commented 9 years ago

But this would have to hit the database. Is that something you'd really like to avoid?

I prefer integration style tests. That being said apparently I've neglected writing any for this project 0_o

Hitting the DB is fine. You can see how we use fixtures in https://github.com/codetriage/codetriage/tree/master/test/fixtures