passbook
Version:
iOS Passbook for the Node hacker
30 lines (25 loc) • 933 B
JavaScript
var assert = require("assert");
var createTemplate = require("../");
describe("Template", function() {
describe("unsupported style", function() {
it("should throw an error", function() {
try {
createTemplate("discount");
assert(false, "Created template with unsupported style 'discount'");
} catch(error) {}
});
});
describe("fields", function() {
before(function() {
this.fields = { passTypeIdentifier: "com.example.passbook" };
this.template = createTemplate("coupon", this.fields);
});
it("should come from constructor", function() {
assert.equal(this.template.passTypeIdentifier(), "com.example.passbook");
});
it("should not change when original object changes", function() {
this.fields.passTypeIdentifier = "com.example.somethingelse";
assert.equal(this.template.passTypeIdentifier(), "com.example.passbook");
});
});
});