<commit_before>describe("Places", function() {

  var placesController;
  var collection;

  beforeEach(function () {
    placesController = new Teikei.Places.Controller();

    collection = new Teikei.Places.Collection([
    {
      id: 1,
      name: "<NAME>",
      city: "Neuruppin",
      address: "Fehrbelliner Str. 45a",
      latitude: "52.913923",
      longitude: "12.8021913",
      accepts_new_members: "yes",
      is_established: true,
      description: "Der Gutshof ist eine Farm",
      contact_name: "<NAME>",
      contact_phone: "03391-12345678",
      type: "Farm",
      user_id: 4,
      updated_at: "2013-05-22T20:27:49Z",
      products: [
      "vegetables",
      "fruit",
      "eggs"
      ]
    },
    {
      id: 2,
      name: "<NAME>",
      city: "Blumberg",
      address: "Friedensweg 11",
      latitude: "52.6068026",
      longitude: "13.6413405",
      accepts_new_members: "yes",
      is_established: true,
      description: "Der Hof Blumberg ist ein Familienbetrieb nordöstlich von Berlin.",
      contact_name: "<NAME>",
      contact_phone: "033394-12345678",
      type: "Farm",
      user_id: 5,
      updated_at: "2013-05-22T20:27:50Z",
      products: [
      "vegetables",
      "fruit",
      "dairy",
      "meat"
      ]
    },
    {
      id: 3,
      name: "<NAME>",
      city: "Grünheide",
      address: "Kienbaumer Weg",
      latitude: "52.4268706",
      longitude: "13.8201102",
      accepts_new_members: "yes",
      is_established: true,
      description: "Unsere Gemüse-Versorger-Gemeinschaft startet am 1. März 2013 ihr zweites Wirtschaftsjahr und ist offen für neue ErnteanteilhaberInnen.",
      contact_name: "<NAME>",
      contact_phone: "030-44400055",
      type: "Farm",
      user_id: 5,
      updated_at: "2013-05-22T20:27:50Z",
      products: [
      "vegetables",
      "fruit"
      ]
      }
    ]);
  });

  afterEach(function () {
    placesController.mapView.markers = [];
  });

  it("should contain a collection.", function() {
    expect(placesController.collection).toBeInstanceOf(Teikei.Places.Collection);
  });

  it("should contain a MapView.", function() {
    expect(placesController.mapView).toBeInstanceOf(Teikei.Places.MapView);
  });

  it("should contain a DetailsView when #showDetails is called.", function() {
    placesController.collection = collection;
    placesController.showDetails(1);
    expect(placesController.detailsView).toBeInstanceOf(Teikei.Places.DetailsView);
  });

  it("should contain a DetailsMessageFormView when #showDetails is called.", function() {
    placesController.collection = collection;
    placesController.showDetails(1);
    expect(placesController.detailsView).toBeInstanceOf(Teikei.Places.DetailsMessageFormView);
  });


  describe("MapView", function(){

    it("should be initialized with a collection", function() {
      expect(placesController.mapView.collection).toBeInstanceOf(Teikei.Places.Collection);
    });

    it("should initialize a marker layer using model data.", function() {
      var model = collection.models[0];
      var markerLayer = placesController.mapView.initMarker(model);

      expect(markerLayer).toBeInstanceOf(L.Marker);
    });

    it("should initialize a marker layer using collection data.", function() {
      var markerLayer = placesController.mapView.initMarkerLayer(collection);

      expect(markerLayer).toBeInstanceOf(L.LayerGroup);
    });

    it("should initialize a tiles layer.", function() {
      var tileLayer = placesController.mapView.initTileLayer();

      expect(tileLayer).toBeInstanceOf(L.TileLayer);
    });

    it("should initialize a tiles layer.", function() {
      var tileLayer = placesController.mapView.initTileLayer();

      expect(tileLayer).toBeInstanceOf(L.TileLayer);
    });

    it("should initialize a tooltip for a certain id.", function() {
      var model = collection.models[0];
      placesController.mapView.initMarkerLayer(collection);

      spyOn(placesController.mapView, "initTip");

      placesController.mapView.showTip(model.id);
      expect(placesController.mapView.initTip).toHaveBeenCalled();
    });

  });


  describe("EntryFarmView", function(){

    xit("should be initialised when the user attempts to add a farm", function() {
      expect(placesController.entryFarmView).toBeInstanceOf(Teikei.Places.EntryFarmView);
    });

    xit("should be removed when the containing modal is closed", function() {

    });

  });

  describe("EntryDepotView", function(){

    xit("should be initialised when the user attempts to add a depot", function() {
      expect(placesController.entryDepotView).toBeInstanceOf(Teikei.Places.EntryFarmView);
    });

    xit("should be removed when the containing modal is closed", function() {

    });

  });

});<commit_msg>Add specs for initializing entry forms.<commit_after>describe("Places", function() {

  var placesController;
  var collection;

  beforeEach(function () {
    placesController = new Teikei.Places.Controller();

    collection = new Teikei.Places.Collection([
    {
      id: 1,
      name: "<NAME>",
      city: "Neuruppin",
      address: "Fehrbelliner Str. 45a",
      latitude: "52.913923",
      longitude: "12.8021913",
      accepts_new_members: "yes",
      is_established: true,
      description: "Der Gutshof ist eine Farm",
      contact_name: "<NAME>",
      contact_phone: "03391-12345678",
      type: "Farm",
      user_id: 4,
      updated_at: "2013-05-22T20:27:49Z",
      products: [
      "vegetables",
      "fruit",
      "eggs"
      ]
    },
    {
      id: 2,
      name: "<NAME>",
      city: "Blumberg",
      address: "Friedensweg 11",
      latitude: "52.6068026",
      longitude: "13.6413405",
      accepts_new_members: "yes",
      is_established: true,
      description: "Der Hof Blumberg ist ein Familienbetrieb nordöstlich von Berlin.",
      contact_name: "<NAME>",
      contact_phone: "033394-12345678",
      type: "Farm",
      user_id: 5,
      updated_at: "2013-05-22T20:27:50Z",
      products: [
      "vegetables",
      "fruit",
      "dairy",
      "meat"
      ]
    },
    {
      id: 3,
      name: "<NAME>",
      city: "Grünheide",
      address: "Kienbaumer Weg",
      latitude: "52.4268706",
      longitude: "13.8201102",
      accepts_new_members: "yes",
      is_established: true,
      description: "Unsere Gemüse-Versorger-Gemeinschaft startet am 1. März 2013 ihr zweites Wirtschaftsjahr und ist offen für neue ErnteanteilhaberInnen.",
      contact_name: "<NAME>",
      contact_phone: "030-44400055",
      type: "Farm",
      user_id: 5,
      updated_at: "2013-05-22T20:27:50Z",
      products: [
      "vegetables",
      "fruit"
      ]
      }
    ]);
  });

  afterEach(function () {
    placesController.mapView.markers = [];
  });

  it("should contain a collection.", function() {
    expect(placesController.collection).toBeInstanceOf(Teikei.Places.Collection);
  });

  it("should contain a MapView.", function() {
    expect(placesController.mapView).toBeInstanceOf(Teikei.Places.MapView);
  });

  it("should contain a DetailsView when #showDetails is called.", function() {
    placesController.collection = collection;
    placesController.showDetails(1);
    expect(placesController.detailsView).toBeInstanceOf(Teikei.Places.DetailsView);
  });

  it("should contain a DetailsMessageFormView when #showDetails is called.", function() {
    placesController.collection = collection;
    placesController.showDetails(1);
    expect(placesController.detailsView).toBeInstanceOf(Teikei.Places.DetailsMessageFormView);
  });


  describe("MapView", function(){

    it("should be initialized with a collection", function() {
      expect(placesController.mapView.collection).toBeInstanceOf(Teikei.Places.Collection);
    });

    it("should initialize a marker layer using model data.", function() {
      var model = collection.models[0];
      var markerLayer = placesController.mapView.initMarker(model);

      expect(markerLayer).toBeInstanceOf(L.Marker);
    });

    it("should initialize a marker layer using collection data.", function() {
      var markerLayer = placesController.mapView.initMarkerLayer(collection);

      expect(markerLayer).toBeInstanceOf(L.LayerGroup);
    });

    it("should initialize a tiles layer.", function() {
      var tileLayer = placesController.mapView.initTileLayer();

      expect(tileLayer).toBeInstanceOf(L.TileLayer);
    });

    it("should initialize a tiles layer.", function() {
      var tileLayer = placesController.mapView.initTileLayer();

      expect(tileLayer).toBeInstanceOf(L.TileLayer);
    });

    it("should initialize a tooltip for a certain id.", function() {
      var model = collection.models[0];
      placesController.mapView.initMarkerLayer(collection);

      spyOn(placesController.mapView, "initTip");

      placesController.mapView.showTip(model.id);
      expect(placesController.mapView.initTip).toHaveBeenCalled();
    });

  });


  describe("EntryFarmView", function(){

    it("should be initialized when user:add:farm is triggered on the app event bus", function() {
      spyOn(placesController, "showEntryForm");
      Teikei.vent.trigger('user:add:farm');
      expect(placesController.showEntryForm).toHaveBeenCalledWith(Teikei.Places.EntryFarmView);
    });

    xit("should be removed when the containing modal is closed", function() {
      // expect(placesController.entryView).toBeInstanceOf(Teikei.Places.EntryFarmView);
    });

  });

  describe("EntryDepotView", function(){

    it("should be initialized when user:add:depot is triggered on the app event bus", function() {
      spyOn(placesController, "showEntryForm");
      Teikei.vent.trigger('user:add:depot');
      expect(placesController.showEntryForm).toHaveBeenCalledWith(Teikei.Places.EntryDepotView);
    });

    xit("should be removed when the containing modal is closed", function() {

    });

  });

});
{'fraction_non_alphanumeric': 0.13041294082186275, 'fraction_numerical': 0.030543554707123482, 'mean_word_length': 3.2684391080617496, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5193560', 'n_tokens_mistral': 3260, 'n_tokens_neox': 2986, 'n_words': 626}