<commit_before>import Ember from "ember";
import { test } from "ember-qunit";
import guessType from "ember-simple-form/utilities/guess-type";

var object = Ember.Object.create();
var input = Ember.Object.create();

test("it detects password by attribute", function(assert) {
  assert.equal(guessType(object, "password", input), "password");
  assert.equal(guessType(object, "passwordConfirmation", input), "password");
});

test("it detects email by attribute", function(assert) {
  assert.equal(guessType(object, "email", input), "email");
  assert.equal(guessType(object, "emailConfirmation", input), "email");
});

test("it detects boolean by attribute", function(assert) {
  assert.equal(guessType(object, "isNice", input), "boolean");
  assert.equal(guessType(object, "hasMustache", input), "boolean");
  assert.equal(guessType(object, "didWashHimself", input), "boolean");
});

test("it detects collection when a collection param is available", function(assert) {
  input = Ember.Object.create({ collection: Ember.A() });
  assert.equal(guessType(object, "role", input), "collection");
  input = Ember.Object.create();
});

test("it recognizes Ember Data attribute types", function(assert) {
  Ember.A(["string", "number", "date", "boolean"]).forEach(function(type) {
    object = {
      metaForProperty: function(p) { return p === "someProperty" && { type: type }; }
    };
    assert.equal(guessType(object, "someProperty", input), type);
    object = Ember.Object.create();
  });
});

test("it returns 'string' by default", function(assert) {
  assert.equal(guessType(object, "role", input), "string");
});
<commit_msg>Fixed failing tests.<commit_after>import Ember from "ember";
import { test } from "ember-qunit";
import guessType from "ember-simple-form/utilities/guess-type";

var object = Ember.Object.create();
var input = Ember.Object.create();

test("it detects password by attribute", function(assert) {
  assert.equal(guessType(object, "password", input), "password");
  assert.equal(guessType(object, "passwordConfirmation", input), "password");
});

test("it detects email by attribute", function(assert) {
  assert.equal(guessType(object, "email", input), "email");
  assert.equal(guessType(object, "emailConfirmation", input), "email");
});

test("it detects boolean by attribute", function(assert) {
  assert.equal(guessType(object, "isNice", input), "boolean");
  assert.equal(guessType(object, "hasMustache", input), "boolean");
  assert.equal(guessType(object, "didWashHimself", input), "boolean");
});

test("it detects collection when a collection param is available", function(assert) {
  input = Ember.Object.create({ collection: Ember.A() });
  assert.equal(guessType(object, "role", input), "collection");
  input = Ember.Object.create();
});

test("it recognizes Ember Data attribute types", function(assert) {
  Ember.A(["string", "number", "date", "boolean"]).forEach(function(type) {
    object = { };
    object.constructor.metaForProperty = function(p) { return p === "someProperty" && { type: type }; };

    assert.equal(guessType(object, "someProperty", input), type);
    object = Ember.Object.create();
  });
});

test("it returns 'string' by default", function(assert) {
  object = { };
  object.constructor.metaForProperty = function(p) { return false; };

  assert.equal(guessType(object, "role", input), "string");

  object = Ember.Object.create();
});

{'fraction_non_alphanumeric': 0.17719659124302087, 'fraction_numerical': 0.0, 'mean_word_length': 5.862903225806452, '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': '5816747', 'n_tokens_mistral': 1050, 'n_tokens_neox': 1034, 'n_words': 247}