title: How to tie Minitest spec to IntegrationTest / Rails data
body: <p>How do I set up a Minitest Spec so it has access to the same Rails data and methods that an <code>IntegrationTest</code> does? </p>
  
  <p>I had been using the "old" Minitest style, and decided to add a new test file using the Spec-style.  However, this test file</p>
  
  <pre><code>require 'minitest/spec'
  require 'minitest/autorun'
  
  describe "Post Controller" do
    describe "#index" do
      it "renders index view" do
        get posts_url
      end
    end # #index
  end
  </code></pre>
  
  <p>fails with this error message:</p>
  
  <pre><code>Error:
  Post Controller::#index#test_0001_renders index view:
  NameError: undefined local variable or method `posts_url' for #&lt;#&lt;Class:0x00007fe064d71210&gt;:0x00007fe064da8260&gt;
      test/controllers/posts_controller_spec_test.rb:7:in `block (3 levels) in &lt;main&gt;'
  </code></pre>
  
  <p>I suspect I need to do something so that the spec is placed in the context of testing a controller (thereby making routes and other things available); but, I don't see how.</p>