Created
May 11, 2015 20:52
-
-
Save alexparker/51b3465f9604452cfd82 to your computer and use it in GitHub Desktop.
This file contains 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
/* jshint expr:true */ | |
import { expect, should } from 'chai'; | |
import { | |
describeModel, | |
it | |
} from 'ember-mocha'; | |
describeModel( | |
'order', | |
'OrderModel', | |
{ needs: ['model:item', 'model:warning'] }, | |
function() { | |
// Replace this with your real tests. | |
it('exists', function() { | |
var model = this.subject(); | |
// var store = this.store(); | |
expect(model).to.be.ok; | |
}); | |
describe('CustomerName', function() { | |
it('combines first and last names', function() { | |
var order = this.subject({ | |
customerFirstName: 'Joe', | |
customerLastName: 'Strummer' | |
}); | |
var customerName = order.get('customerName'); | |
expect(customerName).to.equal('Joe Strummer'); | |
}); | |
}); | |
describe('label', function() { | |
var order = this.subject({ | |
id: 'ASDF-123456', | |
customerFirstName: 'Joe' | |
}); | |
it('returns a customerName if there is one', function() { | |
expect(order.get('label')).to.equal('Joe'); | |
}); | |
it('returns the id if there is no customerName', function() { | |
order.set('customerFirstName', null); | |
order.get('label').should.equal('#ASDF-123456'); | |
}); | |
}); | |
} | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment