Created
March 27, 2015 16:53
-
-
Save abargnesi/a5cb8d1ae896ddccc40e to your computer and use it in GitHub Desktop.
spec
This file contains hidden or 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
| it('empty filter with facet', function(done) { | |
| var onSucc = function(response, status, xhr) { | |
| expect(xhr.status).toEqual(200); | |
| // docs say evidence and facets are in response object | |
| expect(response.evidence).toBeDefined(); | |
| expect(response.facets).toBeDefined(); | |
| // our options shouldn't return more than 20 things | |
| expect(response.evidence.length).not.toBeGreaterThan(100); | |
| // our options should include faceted responses | |
| expect(response.facets.length).toBeGreaterThan(0); | |
| done(); | |
| }; | |
| var onErr = function(xhr) { | |
| expect(xhr.status).toEqual(200); | |
| done(); | |
| }; | |
| var cb = belhop.factory.callback(onSucc, onErr); | |
| var filterFactory = belhop.factory.options.filter.custom; | |
| var searchFactory = belhop.factory.options.search.custom; | |
| var searchOptions = searchFactory(null, 0, 100, true); | |
| console.log(searchOptions); | |
| expect(belhop.evidence.search).toBeDefined(); | |
| belhop.evidence.search(searchOptions, cb); | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment