a response happened and there is a test

This commit is contained in:
Rimian Perkins 2017-02-13 15:31:31 +11:00
parent adeeea3fbb
commit ed828a228b
3 changed files with 25 additions and 1 deletions

View File

@ -2,4 +2,10 @@ export default Ember.Controller.extend({
user: Ember.inject.controller(),
username: Ember.computed.alias('user.model.username_lower'),
email: Ember.computed.alias('user.model.email'),
actions: {
choiceTest: function() {
this.set('saved', true);
}
}
});

View File

@ -1,3 +1,11 @@
<div class="payments">
{{username}}
</div>
<button class='btn btn-primary choice-btn' {{action "choiceTest"}}>
click
</button>
{{#if saved}}
<div class="choice-response">Response happens</div>
{{/if}}

View File

@ -6,6 +6,16 @@ test('Choice Page Exists', () => {
andThen(() => {
ok(exists('h1'), 'Heading exists');
ok($.trim($('.payments').text()) == 'eviltrout', 'eviltrout');
ok($.trim($('.payments').text()) == 'eviltrout', 'username is present on page');
});
});
test('Choice Page response happens', () => {
visit('/users/eviltrout/choice');
click('.choice-btn');
andThen(() => {
ok(exists('.choice-response'), 'Response happens');
});
});