Skip to content
This repository has been archived by the owner on Oct 15, 2019. It is now read-only.

Commit

Permalink
Added new enum value for brand
Browse files Browse the repository at this point in the history
  • Loading branch information
Zenedith committed Dec 31, 2015
1 parent cd2f863 commit 1a9c8a2
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 4 deletions.
1 change: 1 addition & 0 deletions lib/model/brand.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
var Brand = {
HAIRDRESSING: 'HAIRDRESSING',
PRIVATE_MEDIC_DENTAL: 'PRIVATE_MEDIC_DENTAL',
OTHER: 'OTHER',

getBrand: function (type) {
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "receipts-model",
"version": "0.5.10",
"version": "0.5.11",
"description": "Receipts model.",
"main": "./index.js",
"dependencies": {
Expand Down Expand Up @@ -40,6 +40,6 @@
"node": ">=0.10.0"
},
"readmeFilename": "README.md",
"_id": "[email protected].10",
"_from": "receipts-model@^0.5.10"
"_id": "[email protected].11",
"_from": "receipts-model@^0.5.11"
}
1 change: 1 addition & 0 deletions swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,7 @@ definitions:
enum:
- OTHER
- HAIRDRESSING
- PRIVATE_MEDIC_DENTAL
phone:
type: string
description: user phone
Expand Down
10 changes: 9 additions & 1 deletion test/model/brandTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,22 @@ var Brand = require('../../lib/model/brand').Brand;

describe('brand enum test', function () {

it('should get brand', function (done) {
it('should get brand for HAIRDRESSING', function (done) {
var brand = Brand.getBrand('HAIRDRESSING');

should.exist(brand);
brand.should.be.equal(Brand.HAIRDRESSING);
done();
});

it('should get brand for PRIVATE_MEDIC_DENTAL', function (done) {
var brand = Brand.getBrand('PRIVATE_MEDIC_DENTAL');

should.exist(brand);
brand.should.be.equal(Brand.PRIVATE_MEDIC_DENTAL);
done();
});

it('should get OTHER brand for unknown value', function (done) {
var brand = Brand.getBrand('unknown-value');

Expand Down

0 comments on commit 1a9c8a2

Please sign in to comment.