I have a problem in my app where 2 acceptance-tests seem to conflict. If I run the tests one of the 2 tests will fail. The next time I run it the other will fail and so on. They never fail if run one by one..
The first test is testing that visiting a url will redirect to the right path based on whether a model has any records in its toMany-relationship (async). This test fails with: Error: Assertion Failed: Cannot call get with 'currentPath' on an undefined object.
The second test is a test that checks if the toMany relationship is rendered in an unordered-list. This test fails because the content of the list-item is empty.
These are my tests:
test('visiting /categories/#', function() {
visit('/categories/1');
andThen(function() {
equal(currentPath(), 'categories.category.subcategories.index');
});
});
test('renders products', function () {
visit('/categories/2/products');
andThen(function () {
var list = find('#product-list li');
equal(list.length, 2);
var first = find('#product-list li').eq(0);
equal(first.text(), 'A4');
var last = find('#product-list li').eq(1);
equal(last.text(), 'A3');
});
});
Update:
Upgraded to latest ember-cli 0.0.43 now the first test fail is gone (npm install --save-dev ember-cli), but still the second test fails every second time i run the tests..