{"size": 811, "ext": "js", "max_stars_repo_path": "test/models/navigation-item.js", "max_stars_repo_name": "solarphase/app", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "test/models/navigation-item.js", "max_issues_repo_name": "solarphase/app", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "test/models/navigation-item.js", "max_forks_repo_name": "solarphase/app", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 24.5757575758, "max_line_length": 74, "alphanum_fraction": 0.6004932182}
var models = require('../../models');
var should = require('should');

require('./before');

describe('NavigationItem', function() {
  var item = models.NavigationItem.build({ title: 'Test', url: '/test' });

  it('should have a title property', function() {
    item.should.have.property('title');
  });

  it('should have a order property', function() {
    item.should.have.property('order');
  });

  it('should have a enabled property', function() {
    item.should.have.property('enabled');
  });

  describe('#url', function() {
    it('should be a property', function() {
      item.should.have.property('url');
    });

    it('should fall back to the page url if not defined', function() {
      item.url = null;
      item.Page = { url: 'foo' };
      item.url.should.equal('foo');
    });
  });
});
