fix blacklist

This commit is contained in:
Alan Hamlett
2016-06-29 11:11:22 -07:00
parent 38c8a60698
commit 53b60eb90e
2 changed files with 14 additions and 12 deletions

View File

@@ -8,17 +8,19 @@ describe('contains', function() {
expect(contains).to.be.a('function');
});
it('should find the line and return true', function() {
it('should match url against blacklist and return true', function() {
var list = ".app\ntest.com";
var list = "localhost\ntest.com";
expect(contains('.app', list)).to.equal(true);
var url = 'http://localhost/fooapp';
expect(contains(url, list)).to.equal(true);
});
it('should not find the line and it should return false', function() {
it('should not match url against blacklist and return false', function() {
var list = ".app\ntest.com";
var list = "localhost\ntest.com";
expect(contains('.app2', list)).to.equal(false);
var url = 'http://localhost/fooapp';
expect(contains('http://localhost2/fooapp', list)).to.equal(false);
});
});
});