{"size": 1137, "ext": "js", "max_stars_repo_path": "unit/ninjatile.directive.spec.js", "max_stars_repo_name": "linkmesrl/ngIntermediate", "max_stars_repo_stars_event_min_datetime": "2015-11-23T17:22:39.000Z", "max_stars_repo_stars_event_max_datetime": "2015-11-24T09:14:19.000Z", "max_issues_repo_path": "unit/ninjatile.directive.spec.js", "max_issues_repo_name": "linkmesrl/ngIntermediate", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "unit/ninjatile.directive.spec.js", "max_forks_repo_name": "linkmesrl/ngIntermediate", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 2, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 28.425, "max_line_length": 92, "alphanum_fraction": 0.6147757256}
'use strict';

describe('The ninja-tile Directive', function () {

  var element;
  var scope;

  // injecting main module
  beforeEach(module('handlingNinja'));
  beforeEach(module('templates'));

  beforeEach(function() {
    var ninja = {
      'age': 55,
      'name': 'Daniele',
      '_id': '5693fa5af6976c704e00005a',
      '__v': 0
    };
    inject(function ($compile, $rootScope) {
      scope = $rootScope.$new();
      scope.ninja = ninja;
      element = $compile(angular.element('<ninja-tile ninja="ninja"></ninja-tile>'))(scope);
      scope.$apply();
    });
  });
  it('Ninja on isolated scope should be two-way bound', function(){
    var isolatedScope = element.isolateScope();
    isolatedScope.nt.ninja.age = 25;
    expect(scope.ninja.age).toEqual(25);
    scope.$apply();
    expect(parseInt(element.find('.ninja-age').text().trim())).toEqual(25);
  });
  xit('It should contains Daniele', function () {
    expect(element.find('.ninja-name').text().trim()).toEqual('Daniele');
  });
  it('It should have age 55', function () {
    expect(parseInt(element.find('.ninja-age').text().trim())).toEqual(55);
  });
});
