title: Rspec Controller testing in Rails a controller that inherits from AbstractController::Base
body: <p>I am writing controller tests for an application that I did not build, so it's definitely been a learning process. This is my first time encountering a controller that inherits directly from AbstractController::Base. It does not behave, obviously, the same as other controllers. </p>
  
  <p>Its format is roughly:</p>
  
  <pre><code>class SchwadGenericController &lt; AbstractController::Base
    def schwad_method var_one, var_two = nil, var_three = nil
  
      if var_two.blank?
        var_one.generic_method
      end
  
      render template: "schwad_templates/generic_template", layout: false
    end
  end
  </code></pre>
  
  <p>I tried normal testing, this is where I am currently at to get <strong>ANYTHING</strong> to happen.</p>
  
  <pre><code>require 'rails_helper'
  
  describe SchwadGenericController do
    # before(:each) do
    #     SchwadGenericController.skip_authorize_resource
    #   end
    # login_user
    let!(:variable){ create(:my_factory_variable) }
  
  
    describe 'controller methods' do
  
      it 'should hit this method' do
        binding.pry
        SchwadGenericController.schwad_method(variable)
        # expect(response).to_render template: "schwad_templates/generic_template"
      end
    end
  end
  </code></pre>
  
  <p>And here is roughly where my failures are landing. </p>
  
  <pre><code>Failures:
  
     1) SchwadGenericController controller methods should hit this method
        Failure/Error: Unable to find matching line from backtrace
       NoMethodError:
         undefined method `request=' for #   &lt;SchwadGenericController:0x007f8022db0a20&gt;
  </code></pre>
  
  <p>I read up on abstract controllers and their role in rails here: <a href="https://www.mobomo.com/2012/06/and-you-thought-render-farms-were-just-for-pixar/">https://www.mobomo.com/2012/06/and-you-thought-render-farms-were-just-for-pixar/</a></p>
  
  <p>I read up on the docs here: <a href="http://api.rubyonrails.org/classes/AbstractController/Base.html">http://api.rubyonrails.org/classes/AbstractController/Base.html</a></p>
  
  <p>I would really appreciate another set of eyes on this and guidance as to how you guys have tested controllers and their methods, with controllers that are inheriting from AbstractController::Base.... What am I missing?</p>
  
  <p>-Schwad</p>