emberjs/ember.js — pull request #2724 by teddyzeenny (2013-05-23 21:59:43+00:00)
Title: Added the ability to chain test helpers

This gives us the ability to chain helpers:

```javascript
test("Adding a post", function() {

visit('posts/new')
.fillIn('.txt-title', 'My Post')
.fillIn('.txt-body', 'This is the body')
.click('.btn-submit')
.then(function() {
equal(find('.post-title').text(), 'My Post');
equal(find('.post-body').text(), 'This is the body');
})
.click('.post-title')
.click('.btn-new-comment')
.fillIn('.txt-comment-body', 'My Comment')
.click('.submit')
.then(function() {
equal(find('.comment').length, 1);
});

});
```

Any custom helpers added using `Ember.Test.registerHelper` method would also be chained:

```javascript
Ember.Test.registerHelper('boot', function(app) {
Em.run(app, app.advanceReadiness);
return wait();
});

Ember.Test.registerHelper('reset', function(app) {
app.reset();
return wait();
});

// ... later in the test
boot().visit('posts').click('.post-name').reset();

```