title: Jasmine Unit Test for http
body: <p>I am trying to write unit tests cases around an Angular service.  What I am basically trying to test is that the http request is made.</p>
  
  <p>Service</p>
  
  <pre><code>app.service("myService", [
      "$http", function ($http) {
          this.result = "initial value";
          this.get = function (param1, param2) {
              return $http({
                  method: "GET",
                  url: "api/someService/Get/" + param1 + "/" + param2
              })
                  .success(function (data) {
                      this.parent.result = data;
                      console.log(data);
                          console.log(this.parent.result);
                      return data;
                  })
                  .error(function () {
                      return "Error occurred";
                  })
              ;
          };
      }
  ]);
  </code></pre>
  
  <p>Below is what I have tried.</p>
  
  <pre><code>describe("Surcharge Increase Formula", function () {
      var controller;
      var scope;
      var httpBackend;
      var myService;
  
      beforeEach(inject(function($controller, $rootScope, $httpBackend, _myService_) {
          scope = $rootScope.$new();
          httpBackend = $httpBackend;
          myService = _myService_;
      });
  
      it('waiver service makes API call', function () {
          var response = "This is the response";
          httpBackend.when('GET', "api/SurchargeWaiver/Get/0/0").respond(response);
  
          waiverService.get(0, 0);
          //httpBackend.flush();
  
          expect(waiverService.result).toEqual(response);
  
  
      });
  </code></pre>
  
  <p>What I would like to do is make a call similar to expect(...).toHaveBeenCalled() to see if the api call has been made, or any other way to just test the http call.</p>
  
  <p>Any suggestions?</p>