Skip to content

Instantly share code, notes, and snippets.

@oliverbarnes
Created November 18, 2014 23:49
Show Gist options
  • Save oliverbarnes/abbbaf592df11b0b80b7 to your computer and use it in GitHub Desktop.
Save oliverbarnes/abbbaf592df11b0b80b7 to your computer and use it in GitHub Desktop.
Timeout failure on ember-cli-mocha test
not ok 6 PhantomJS 1.9 - Posting an initiative before posting "before each" hook
---
message: >
timeout of 2000ms exceeded
Log: >
...
not ok 7 PhantomJS 1.9 - Posting an initiative when the initiative is valid "before each" hook
---
message: >
timeout of 2000ms exceeded
Log: >
...
import Ember from 'ember';
import startApp from '../helpers/start-app';
var App;
describe('Posting an initiative', function() {
beforeEach(function(){
App = startApp();
});
afterEach(function() {
Ember.run(App, 'destroy');
});
describe('before posting', function (done) {
beforeEach(function (done) {
visit('/');
click( $("a:contains('Start a new initiative')") );
});
it('the submit button is disabled', function (done) {
expect($(':submit').attr('disabled')).to.equal('disabled');
});
it('url path is /initiatives/new', function (done) {
expect(currentURL()).to.equal('/initiatives/new');
});
});
describe('when the initiative is valid', function (done) {
beforeEach(function (done) {
visit('/');
click( $("a:contains('Start a new initiative')") );
fillIn('div.title input', 'Public health clinic');
fillIn('div.description textarea', 'Allocate compensation money to create a local public health clinic');
fillIn('div.issue_title input', "What to do with the compensation money from the dam's impact?");
fillIn('div.issue_description textarea', "The contruction company in charge of the dam will pay 10 million in compensation to the local affected population. What to do with it?");
click('form input[type=submit]');
});
it('current path is initiatives.initiative.index', function (done) {
expect(currentPath()).to.equal('initiatives.initiative.index');
});
it('the title is displayed', function (done) {
expect(find('.title').text()).to.equal('Public health clinic');
});
it('the description is displayed', function (done) {
expect(find('.description').text()).to.equal('Allocate compensation money to create a local public health clinic');
});
it('the issue title is displayed', function (done) {
expect(find('.issue_title').text()).to.equal("For issue: What to do with the compensation money from the dam's impact?");
});
});
});
@clekstro
Copy link

Were you ever able to track this down?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment