Update README.md
[tech-radar.git] / test / models / blip-spec.js
1 describe('tr.models.Blip', function () {
2 var blip;
3 beforeEach(function () {
4 blip = new tr.models.Blip(
5 'My Blip',
6 new tr.models.Cycle('My Cycle')
7 );
8 });
9
10 it('has a name', function () {
11 expect(blip.name()).toEqual('My Blip');
12 });
13
14 it('has a cycle', function () {
15 expect(blip.cycle().name()).toEqual('My Cycle');
16 });
17
18 it('has a default number', function () {
19 expect(blip.number()).toEqual(-1);
20 });
21
22 it('sets the number', function () {
23 blip.setNumber(1);
24 expect(blip.number()).toEqual(1);
25 });
26
27 it('is new', function () {
28 blip = new tr.models.Blip(
29 'My Blip',
30 new tr.models.Cycle('My Cycle'),
31 true
32 );
33
34 expect(blip.isNew()).toBe(true);
35 });
36
37 it('is not new', function () {
38 blip = new tr.models.Blip(
39 'My Blip',
40 new tr.models.Cycle('My Cycle'),
41 false
42 );
43
44 expect(blip.isNew()).toBe(false);
45 });
46 });