Skip to content

Commit e100d21

Browse files
committed
added another location test
1 parent 4dbb757 commit e100d21

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

server/db/models/location/location.spec.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,23 @@ describe('Location model', () => {
2525
})
2626
})
2727
})
28+
29+
describe('location url type validation', () => {
30+
let url
31+
32+
beforeEach(() => {
33+
url = Location.build({
34+
url: 'test'
35+
})
36+
})
37+
38+
it('throw an validation error when location is not an url', () => {
39+
return url.validate()
40+
.then(() => {
41+
throw new Error('validation should fail when content is less than 10 words')
42+
}, (result) => {
43+
expect(result).to.be.an.instanceOf(Error);
44+
})
45+
})
46+
})
2847
})

0 commit comments

Comments
 (0)