<commit_before>var cdb = require('cartodb.js');
var ImportsModel = require('../../../../../javascripts/cartodb/common/background_polling/models/imports_model');
var BackgroundImportItemView = require('../../../../../javascripts/cartodb/common/background_polling/views/imports/background_import_item_view');

describe('common/background_importer/background_importer_item_view', function() {

  beforeEach(function() {
    var user = new cdb.admin.User({
      base_url: 'http://paco.cartodb.com',
      username: 'paco'
    });
    this.model = new ImportsModel();

    spyOn(this.model, 'bind').and.callThrough();

    this.view = new BackgroundImportItemView({
      createVis: false,
      model: this.model,
      user: user
    });
  });

  it('should render properly', function() {
    this.view.render();
    expect(this.view.$el.hasClass('ImportItem')).toBeTruthy();
    expect(this.view.$('.ImportItem-text').length).toBe(1);
  });

  it('should bind model changes', function() {
    expect(this.model.bind.calls.argsFor(0)[0]).toEqual('change:state');
    expect(this.model.bind.calls.argsFor(1)[0]).toEqual('change');
    expect(this.model.bind.calls.argsFor(2)[0]).toEqual('remove');
  });
<commit_msg>Fixing background importer item view specs<commit_after>var cdb = require('cartodb.js');
var ImportsModel = require('../../../../../javascripts/cartodb/common/background_polling/models/imports_model');
var BackgroundImportItemView = require('../../../../../javascripts/cartodb/common/background_polling/views/imports/background_import_item_view');

describe('common/background_importer/background_importer_item_view', function() {

  beforeEach(function() {
    var user = new cdb.admin.User({
      base_url: 'http://paco.cartodb.com',
      username: 'paco'
    });
    this.model = new ImportsModel();

    spyOn(this.model, 'bind').and.callThrough();

    this.view = new BackgroundImportItemView({
      createVis: false,
      model: this.model,
      user: user
    });
  });

  it('should render properly', function() {
    this.view.render();
    expect(this.view.$el.hasClass('ImportItem')).toBeTruthy();
    expect(this.view.$('.ImportItem-text').length).toBe(1);
  });

  it('should bind model changes', function() {
    expect(this.model.bind.calls.argsFor(0)[0]).toEqual('change');
    expect(this.model.bind.calls.argsFor(1)[0]).toEqual('remove');
  });

{'fraction_non_alphanumeric': 0.18765743073047858, 'fraction_numerical': 0.005037783375314861, 'mean_word_length': 3.9439834024896268, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '4235196', 'n_tokens_mistral': 758, 'n_tokens_neox': 748, 'n_words': 102}