title: Webmock Unregistered request blows up my test
body: <p>In my <code>spec_helper</code>, I have webmock setup like so:</p>
  
  <pre><code>WebMock.disable_net_connect!(allow_localhost: true)
  
  RSpec.configure do |config|
    config.before(:each) do
      stub_request(:get, /cdn.\w+.io/).
        with(:headers =&gt; {'Accept-Encoding'=&gt;'gzip', 'Access-Token'=&gt; ENV['ACCESS_TOKEN'], 'Api-Key'=&gt;ENV['API_KEY'], 'Expect'=&gt;'', 'User-Agent'=&gt;'Typhoeus - https://github.com/typhoeus/typhoeus'}).
        to_return(:status =&gt; 200, :body =&gt; "", :headers =&gt; {})
    end
  end
  </code></pre>
  
  <p>Now when I run this test individually using <code>bundle exec rspec spec/stack_client_query_spec.rb</code>, it passes.</p>
  
  <pre><code>  describe "can query for entries by asking for a content_type" do
      it "returns a Typhoeus response with queried with a content_type" do
        response = create_client.content_type(content_type_uid).get
        expect(response).to be_instance_of(Typhoeus::Response)
      end
    end
  </code></pre>
  
  <p>However when I run the full test suite using <code>bundle exec rspec</code>, the <em>same</em> test blows up with this output:</p>
  
  <pre><code>Failure/Error:
         response = Typhoeus::Request.new(
           endpoint,
           headers: { api_key: headers[:api_key], access_token: headers[:access_token],
           accept_encoding: "gzip" }
         ).run
  
       WebMock::NetConnectNotAllowedError:
         Real HTTP connections are disabled. Unregistered request: GET http://cdn.mycustom.domain/v3/content_types/shirts/entries/ with headers {'Accept-Encoding'=&gt;'gzip', 'Access-Token'=&gt;'bltbdc42da30987971c', 'Api-Key'=&gt;'blt1c501b5fa4b64377', 'Expect'=&gt;'', 'User-Agent'=&gt;'Typhoeus - https://github.com/typhoeus/typhoeus'}
  
         You can stub this request with the following snippet:
  
         stub_request(:get, "http://cdn.mycustom.domain/v3/content_types/shirts/entries/").
           with(:headers =&gt; {'Accept-Encoding'=&gt;'gzip', 'Access-Token'=&gt;'bltbdc42da30987971c', 'Api-Key'=&gt;'blt1c501b5fa4b64377', 'Expect'=&gt;'', 'User-Agent'=&gt;'Typhoeus - https://github.com/typhoeus/typhoeus'}).
           to_return(:status =&gt; 200, :body =&gt; "", :headers =&gt; {})
  
         registered request stubs:
  
         stub_request(:get, "/cdn.\w+.io/").
           with(:headers =&gt; {'Accept-Encoding'=&gt;'gzip', 'Access-Token'=&gt;'bltbdc42da30987971c', 'Api-Key'=&gt;'blt1c501b5fa4b64377', 'Expect'=&gt;'', 'User-Agent'=&gt;'Typhoeus - https://github.com/typhoeus/typhoeus'})
  </code></pre>
  
  <p>It seems like an earlier test is overwriting the request domain or something. I am not sure why!? What am I doing wrong? How do I fix this?</p>