title: How to write behavioral/functional/endpoint tests using Angular and Jasmine + $resource?
body: <p>I want to write functional test of the server's endpoints. I'm not doing e2e testing. This is more of a functional/behavioral test.  </p>
  
  <pre><code>    beforeEach(inject(function ($injector) {
          f = $injector.get('WidgetFactory');
      }));
  
      it('should have a factory and get all widgets',inject(function($timeout ){
         expect(f).toBeDefined();
         expect(f).toBeTruthy();
  
         var qArray = f.query();
  
         $timeout.flush()
  
         expect(qArray.length).toBe(3);
      }));
  </code></pre>
  
  <p>However, jasmine produces this error:</p>
  
  <pre><code>unexpected request: GET http://some.made.up.service:8080/widget/ 
  No more request expected
  </code></pre>
  
  <p>I <strong>do not</strong> want to mock it with <code>httpBackend.whenGET()</code>, I want to actually test my endpoint for undesired behavior (AKA blame the backend team). My unit tests that mock the response are a separate spec file.</p>
  
  <p>Any way to do this with jasmine? I'd like to not also have to add protractor or mocha.</p>