a response happened and there is a test
This commit is contained in:
parent
adeeea3fbb
commit
ed828a228b
|
@ -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);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
|
@ -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}}
|
||||
|
|
|
@ -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');
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue