title: Rails: what do I test in controller/view/request/feature tests respectively?
body: <p>So I <code>rails g scaffold bar content:string</code> in Rails, it generates a whole lot of things. As a newbie in testing, I have little idea on what to put in each category.</p>
  
  <p>Some context first:</p>
  
  <ul>
  <li>The testing framework is <em>RSpec</em></li>
  <li>I'm using <em>devise</em> for authentication and <em>pundit</em> for authorization</li>
  <li>The <em>bar</em> resource only allow accesses from authenticated users</li>
  <li>Each user is only authorized to CRUD his own <em>bar</em> resource</li>
  </ul>
  
  <p><strong>Now the problem (I know it's a lot, sorry!):</strong></p>
  
  <ol>
  <li>If I've already unit tested my pundit policies, do I need to test about authorizations in my controller specs?</li>
  <li>Do I test authentication in controller specs? Or should I just leave it to request specs?</li>
  <li>Is separated view tests necessary? I've been told more than once that it's not necessary and I should just go with feature specs.</li>
  <li>About request specs, do I need to test all 3 scenarios namely <em>not authenticated</em>, <em>authenticated but not authorized</em>, <em>authorized</em> for each action?</li>
  <li>What's the scope of feature tests? Do I test major functionalities or also every corner case?</li>
  </ol>