I have a problem in my application where 2 acceptance tests seem to conflict. If I run the tests, one of the two tests will fail. The next time I run it, the other will fail and so on. They never crash if they run one after another.
The first test is testing that the visit to the URL will be redirected to the correct path based on whether the model has any entries in its toMany relationship (async). This test fails: Error: Validation failed: Unable to call get with "currentPath" in the undefined object.
The second test is a test that checks if the toMany relation is displayed in an unordered list. This test failed because the contents of the list item are 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'); }); });
Full code
Application launch
Running tests
Update:
Updated to the latest version of ember-cli 0.0.43 now the first test failure (npm install --save-dev ember-cli), but the second test fails every second time I run the tests.
source share