Testing each filters with multiple values.

This commit is contained in:
Mathieu Lecarme 2011-12-05 21:14:55 +01:00
parent 6783d9f642
commit 4cf4291c5b
3 changed files with 32 additions and 0 deletions

View File

@ -57,6 +57,17 @@ test('match true', function(t) {
}); });
test('match multiple', function(t) {
var f = new EqualityFilter({
attribute: 'foo',
value: 'bar'
});
t.ok(f);
t.ok(f.matches({ foo: ['plop', 'bar'] }));
t.end();
});
test('match false', function(t) { test('match false', function(t) {
var f = new EqualityFilter({ var f = new EqualityFilter({
attribute: 'foo', attribute: 'foo',

View File

@ -57,6 +57,16 @@ test('match true', function(t) {
}); });
test('match multiple', function(t) {
var f = new GreaterThanEqualsFilter({
attribute: 'foo',
value: 'bar'
});
t.ok(f);
t.ok(f.matches({ foo: ['beuha', 'baz'] }));
t.end();
});
test('match false', function(t) { test('match false', function(t) {
var f = new GreaterThanEqualsFilter({ var f = new GreaterThanEqualsFilter({
attribute: 'foo', attribute: 'foo',

View File

@ -57,6 +57,17 @@ test('match true', function(t) {
}); });
test('match multiple', function(t) {
var f = new LessThanEqualsFilter({
attribute: 'foo',
value: 'bar'
});
t.ok(f);
t.ok(f.matches({ foo: ['abc', 'beuha'] }));
t.end();
});
test('match false', function(t) { test('match false', function(t) {
var f = new LessThanEqualsFilter({ var f = new LessThanEqualsFilter({
attribute: 'foo', attribute: 'foo',