[client action] add a test to prove 21b2176

This commit is contained in:
spalger
2016-07-06 22:36:27 -06:00
parent 21b21764bc
commit 913469bb48

View File

@ -264,7 +264,7 @@ describe('Client Action runner', function () {
beforeEach(function () {
action = makeClientAction({
params: {
one: { type: 'enum', options: ['opt', 'other opt', '150'] }
one: { type: 'enum', options: ['opt', 'other opt', '150', 'true'] }
}
});
});
@ -289,6 +289,16 @@ describe('Client Action runner', function () {
});
});
it('accepts string versions of booleans', function (done) {
action({
one: true
}, function (err, params) {
if (err) { throw err; }
expect(params.query.one).to.be('true');
done();
});
});
it('it rejects things not in the list', function (done) {
action({
one: 'not an opt'