Created
January 14, 2014 22:45
-
-
Save rserna2010/8427433 to your computer and use it in GitHub Desktop.
failing test
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| asyncTest('debit bank account', 2, function(assert) { | |
| var stub = sinon.stub(Balanced.Adapter, "create"); | |
| visit(Testing.BANK_ACCOUNT_ROUTE).then(function() { | |
| var controller = Balanced.__container__.lookup('controller:bankAccounts'); | |
| var model = controller.get('model'); | |
| model.set('can_debit', true); | |
| stop(); | |
| Ember.run.next(function() { | |
| start(); | |
| click(".main-header .buttons a.debit-button") | |
| .then(function() { | |
| assert.equal( | |
| $('label.control-label:contains(characters max):visible').text(), | |
| 'Appears on statement as (14 characters max)' | |
| ); | |
| assert.equal( | |
| $('input[name="appears_on_statement_as"]:visible').attr('maxlength'), | |
| '14' | |
| ); | |
| }) | |
| .fillIn('#debit-funding-instrument .modal-body input[name="dollar_amount"]', '1000') | |
| .fillIn('#debit-funding-instrument .modal-body input[name="description"]', 'Test debit') | |
| .click('#debit-funding-instrument .modal-footer button[name="modal-submit"]') | |
| .then(function() { | |
| assert.ok(stub.calledOnce); | |
| assert.ok(stub.calledWith(Balanced.Debit, '/bank_accounts/' + Testing.BANK_ACCOUNT_ID + '/debits', sinon.match({ | |
| amount: 100000, | |
| description: "Test debit" | |
| }))); | |
| start(); | |
| }); | |
| }); | |
| }); | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment