title: Angularjs frontend Jasmine unit test issue
body: <p>i have tested my javascript code with jasmine but when i see my jenkins unit tests coverage, i have some rows that are not marked green ( not tested ) . So this is why i'm asking my question : </p>
  
  <p>--> Assuming that tagStyle.length = 0 </p>
  
  <pre><code>                $scope.isTagStylesNotEmpty = function() {
                      if($scope.tagStyles.length &gt;= 0) /* This line is RED (not covered ) */
                      {
                              return true;/* This line is Green OK*/
                      }
                  }
  </code></pre>
  
  <p>--> My test is the following : </p>
  
  <pre><code>  it('Unit test isTagStylesNotEmpty()', inject(function($httpBackend) {
      expect($scope.isTagStylesNotEmpty).toBeDefined();
      $scope.isTagStylesNotEmpty();
      expect($scope.tagStyles.length).toBe(0);
      }));
  </code></pre>
  
  <p>Any ideas about that point ? </p>
  
  <p>Second question is the same as the first one but a little bit complicated : </p>
  
  <p>i have the following Javascript file that i want to unit test with jasmine : </p>
  
  <pre><code>    $scope.ajouterProfilTag = function(lastDocId) {
  
      $scope.tagStyles.forEach(function(item) {
                     /*Not covered from here (by jenkins )--------------------*/
          var profilTag = {
              tag: item.id_tag,
              texte: item.style,
              profil: lastDocId,
              tagName: item.label,
              police:  item.police,
              taille: item.taille,
              interligne: item.interligne ,
              styleValue: item.styleValue,
          };
  
          $http.post('/ajouterProfilTag', profilTag)
              .success(function(data) {
  
                  $scope.profilTagFlag = data; /* unit tests */
                  $scope.afficherProfils();
                  $scope.profilTag = {};
                  $scope.tagStyles.length = 0;
                  $scope.tagStyles = [];
              /*Until here --------------------*/
          });
  
      });
  
      $scope.tagList = {};
      $scope.policeList = {};
      $scope.tailleList = {};
      $scope.interligneList = {};
      $scope.weightList = {};
  
  };
  </code></pre>
  
  <p>my unit test is something like this : </p>
  
  <pre><code> var profil = {
      _id: "52d8f928548367ee2d000006",
      photo: "./files/profilImage.jpg",
      descriptif: "descriptif3",
      niveauScolaire: "CM2",
      type: "Dyslexie N2",
      nom: "Nom3"
    };
  
  
  
      var profilTag = {
          _id: "52d8f928548367ee2d000006",
          tag: "tag",
          texte: "texte",
          profil: "profil",
          tagName: "tagName",
          police: "Arial",
          taille: "eight",
          interligne: "fourteen",
          styleValue: "Bold"
        }
  
      beforeEach(inject(function($controller, $rootScope, $httpBackend) {
          $scope = $rootScope.$new();
          controller = $controller('ProfilesCtrl', {
            $scope: $scope
          });
  
  
          $httpBackend.whenPOST('/ajouterProfilTag').respond(profilTag);
  
  
  
        }));
  
        it('ProfilesCtrl:ajouterProfilTag should set ajouterProfilTag function', inject(function($httpBackend) {
           expect($scope.ajouterProfilTag).toBeDefined();
           $scope.ajouterProfilTag(profil._id);
            $httpBackend.flush();
            expect($scope.profilTagFlag).toEqual(profilTag);
  
        }));
  </code></pre>
  
  <p>Anyh ideas about how do i have to unit test my second method (AjouterProfilTag) ?? thanks in advance </p>