{"componentChunkName":"component---src-templates-blog-post-js","path":"/finding-missing-test-coverage-in-rails/","result":{"data":{"site":{"siteMetadata":{"title":"Enlightened Pixel - Ruby on Rails Web Development and Consulting Studio","author":"Alex Brinkman"}},"markdownRemark":{"id":"1484f21c-5598-58a3-9d85-78dfde1624eb","excerpt":"Here's a little testing trick I use while working in Rails. When I'm trying to find areas of code that are missing test coverage, I like to individually run the…","html":"<p>Here's a little testing trick I use while working in Rails. When I'm trying to find areas of code that are missing test coverage, I like to individually run the different types of tests, then check the coverage for that type. So instead of simply running <code class=\"language-text\">rspec</code>, I'll first run each of the following:</p>\n<div class=\"gatsby-highlight\" data-language=\"ruby\"><pre class=\"language-ruby\"><code class=\"language-ruby\">  rake spec<span class=\"token symbol\">:models</span>\n  rake spec<span class=\"token symbol\">:controllers</span>\n  rake spec<span class=\"token symbol\">:helpers</span>\n  rake spec<span class=\"token symbol\">:features</span></code></pre></div>\n<p>I find that if I mix feature tests with any of the other test types, that many lines of code are incidentally run that I don't have adequate coverage for. By running the different tests in isolation, it's much easier to identify gaps in real coverage.</p>","frontmatter":{"date":"December 7, 2016","title":"Finding Missing Test Coverage in Rails","categories":["Development"]}}},"pageContext":{"slug":"/finding-missing-test-coverage-in-rails/","previous":{"fields":{"slug":"/enough-piling-on-java/"},"frontmatter":{"title":"Enough Piling on Java","layout":"post","permalink":"/enough-piling-on-java/","published":true}},"next":{"fields":{"slug":"/three-things-i-learned-this-week-december-09-2016/"},"frontmatter":{"title":"Three Things I Learned This Week - December 09 2016","layout":"post","permalink":"/three-things-i-learned-this-week-december-09-2016/","published":true}}}}}