forked from mozilla/openbadges-backpack
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1bac707
commit e7b1437
Showing
2 changed files
with
35 additions
and
53 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
const test = require('tap').test; | ||
const testUtils = require('./'); | ||
const Portfolio = require('../models/portfolio'); | ||
const User = require('../models/user'); | ||
const Group = require('../models/group'); | ||
|
||
const UNICODE_TITLE = "てすと"; | ||
|
||
testUtils.prepareDatabase({ | ||
'1-user': new User({ email: '[email protected]' }), | ||
'2-group': new Group({ user_id: 1, name: 'lol', badges: [] }) | ||
}, function () { | ||
|
||
test('Portfolio#save: unicode characters in the title', function (t) { | ||
const portfolio = new Portfolio({ | ||
group_id: 1, | ||
title: UNICODE_TITLE, | ||
stories: {} | ||
}); | ||
|
||
portfolio.save(function (err, result) { | ||
t.notOk(err, 'should not have an error'); | ||
|
||
Portfolio.findOne({ title: UNICODE_TITLE }, function (err, result) { | ||
t.notOk(err, 'should not have an error'); | ||
t.ok(result, 'should have a result') | ||
t.same(result.get('title'), UNICODE_TITLE, 'should have the correct title'); | ||
t.end(); | ||
}); | ||
}); | ||
}); | ||
|
||
testUtils.finish(test); | ||
}) | ||
|