Created
September 22, 2014 09:37
-
-
Save gajus/c93f8bac2fe402881916 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
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