Skip to content

Instantly share code, notes, and snippets.

@gajus
Created September 22, 2014 09:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gajus/c93f8bac2fe402881916 to your computer and use it in GitHub Desktop.
Save gajus/c93f8bac2fe402881916 to your computer and use it in GitHub Desktop.
describe('Seminar', function () {
it('has a name', function () {
var seminar = SeminarFactory.create({name: 'JavaScript'});
expect(seminar.getName()).toEqual('JavaScript');
});
it('has a price', function () {
var seminar = SeminarFactory.create({price: 10});
expect(seminar.getPrice()).toEqual(10);
});
it('has a gross price that adds 20% to the net price', function () {
var seminar = SeminarFactory.create({price: 10});
expect(seminar.getGrossPrice()).toEqual(12);
});
});
describe('A tax-free Seminar', function () {
var seminar;
beforeEach(function () {
seminar = SeminarFactory.create({taxFree: true, price: 100});
});
it('must be tax-free', function () {
expect(seminar.isTaxFree()).toBeTruthy();
});
it('must have a gross price thats matches the net price', function () {
expect(seminar.getPrice()).toEqual(seminar.getGrossPrice());
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment