Acceptance Testing in Action
To create an acceptance test, run ember generate acceptance-test <name>
. For example:
ember g acceptance-test sign-in-test.js
Suppose we have a login page page like below. Here when user provides valid email and password user have to go to the dashboard.
Then our test case acceptance-test/sign-in-test.js would be like this.
describe('success', function() {
beforeEach(function() {
server.create('user', {
email: '[email protected]',
password: 'guest'
});
});
it('transitions to the dashboard on successful login');
it('shows a flash message on successful login');
});