(function() {
    'use strict';

    var httpBackend;

    beforeEach(function() {
        module('antidote');
        inject(function($httpBackend) {
            httpBackend = $httpBackend;
        });
    });

    afterEach(function() {
        httpBackend.verifyNoOutstandingExpectation();
        httpBackend.verifyNoOutstandingRequest();
    });

    describe('DrugsListCtrl', function() {
        it('should show call drugs service to get the list', inject(function($controller) {
            var returnData = [{id: 1}];
            httpBackend.expectGET('/api/autocomplete/drugs').respond(returnData);

            var vm = $controller('DrugsListCtrl');

            httpBackend.flush();
            expect(vm.drugs[0].id).toEqual(1);
        }));
    });

    describe('DrugsViewCtrl', function() {
        it('should show call drugs service to get the record', inject(function($controller, $rootScope) {
            var returnData = {id: 2};
            httpBackend.expectGET('/api/drugs/2').respond(returnData);

            var scope = $rootScope.$new();
            var vm = $controller('DrugsViewCtrl', {
                $stateParams: {id: 2},
                $scope: scope
            });

            httpBackend.flush();
            expect(vm.drug.id).toEqual(2);
        }));
    });
})();

@@ -811,37 +811,32 @@
      it('should 
-show 
 call drugs servi
@@ -855,16 +855,34 @@
 e record
+ and top 2 reviews
 ', injec
@@ -935,32 +935,62 @@
     
-var returnData = 
+httpBackend.expectGET('/api/drugs/2').respond(
 %7Bid: 2%7D
+)
 ;%0A  
@@ -1034,37 +1034,69 @@
 /drugs/2
-').respond(returnData
+/reviews?limit=2').respond(%7Bdata: %5B%7Bid: 1%7D, %7Bid: 2%7D%5D%7D
 );%0A%0A    

fix karma unit test for drug controller