20 lines
653 B
JavaScript
20 lines
653 B
JavaScript
describe("app.models.Contact", function() {
|
|
|
|
beforeEach(function(){
|
|
this.aspect = factory.aspect();
|
|
this.contact = new app.models.Contact({
|
|
person: { name: "aaa" },
|
|
aspect_memberships: [{id: 42, aspect: this.aspect}]
|
|
});
|
|
});
|
|
|
|
describe("inAspect", function(){
|
|
it("returns true if the contact has been added to the aspect", function(){
|
|
expect(this.contact.inAspect(this.aspect.id)).toBeTruethy;
|
|
});
|
|
|
|
it("returns false if the contact hasn't been added to the aspect", function(){
|
|
expect(this.contact.inAspect(this.aspect.id+1)).toBeFalsy;
|
|
});
|
|
});
|
|
});
|