title: Testing unit with skip_before_action does not unset after using TDD
body: <p>I am using Rails 5.2 and doing some testing. I am trying my unit testing with <code>ActionController::TestCase</code> and found that <code>@controller.class.skip_before_action :verify_user</code> does not reset the controller automatically before going to the next test unit method.</p>
  
  <p>Now because rails tests are randomized at every run, certain unit fails sometimes and not other times. I figured it was expecting HTTP 401 but I got 200. Cause the controller ignored to <code>before_action :verify_user</code>.</p>
  
  <p>I could set <code>@controller.class.before_action :verify_user</code> at end of every unit (and it works!) but should it not be the rep of testing sys to reset context before every run?</p>
  
  <p>Giving a snip of my code:</p>
  
  <pre><code>class ApiSiteMetricsTest &lt; ActionController::TestCase
    tests Api::SiteMetricsController
  
    def test_1_index
      @controller.class.skip_before_action :verify_user,raise: false
  
      get "index",  params:{ 
          "format"=&gt;"json",
          "site_metric_value"=&gt;{
              "site_metric_id"=&gt;2403, 
              "date_acquired"=&gt;"2018-03-14T01:44:00+05:30", 
              "site_id"=&gt;3840, 
              "lab_device_details"=&gt;"", 
              "comment"=&gt;"", 
              "sender_affiliation"=&gt;"", 
              "float_value"=&gt;""
          }
      }
      assert_response :success
      File.open("#{Rails.root}/del.html", "wb") { |f| f.write(@response.body) }        
      #Do I have to do this o every test?
      #@controller.class.before_action :verify_user
    end
    ...
  </code></pre>