import Ember from 'ember';

export default function() {
  Ember.Test.registerAsyncHelper('select', function(app, selector, text) {
    const $el = app.testHelpers.findWithAssert(`${selector} option:contains("${text}")`);

    $el.each(function() {
      Ember.run(() => {
        this.selected = true;
        Ember.$(this).trigger('change');
      });
    });

    return app.testHelpers.wait();
  });
}

import Ember from 'ember';

export default function() {
  Ember.Test.registerAsyncHelper('select', function(app, selector, text) {
    var $el = app.testHelpers.findWithAssert(selector + "option:contains('" + text + "')");

    $el.each(function() {
      var _this = this;

      Ember.run(function() {
        _this.selected = true;
        Ember.$(_this).trigger('change');
      });
    });

    return app.testHelpers.wait();
  });
}

Stop using ES6 due to PhantomJS issues
Stop using ES6 due to PhantomJS issues
