Last active
September 14, 2017 12:35
-
-
Save danilat/31828dd41439763d5741a73285f13cbe to your computer and use it in GitHub Desktop.
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
beforeEach(()=> { | |
httpClient = new mosica.HttpClient(); | |
matcher = new mosica.Matcher(); | |
gigService = new mosica.GigService(httpClient, matcher); | |
httpClientStub = sinon.stub(httpClient, 'get').returns({ | |
then: function(resp){ | |
return resp({body: {response: someGigsByDay}}); | |
} | |
}); | |
}); | |
//... | |
it('gets the gigs', () => { | |
return gigService.retrieveNextGigs().then((gigsByDay) => { | |
let gigs = gigsByDay[0].gigs; | |
expect(gigs.length).to.be.equal(2); | |
expect(gigs[0].title).to.be.equal('dead bronco'); | |
expect(gigs[1].title).to.be.equal('celtas cortos'); | |
}); | |
}); | |
//... | |
it('gets an existent gig', () => { | |
return gigService.retrieveAGig(1).then((gig) => { | |
expect(gig.title).to.be.equal('dead bronco'); | |
}); | |
}); | |
//... | |
it('find the gigs normalizing accents', () => { | |
return gigService.searchGigs('lopez').then((gigs) => { | |
expect(gigs.length).to.be.equal(1); | |
expect(gigs[0].title).to.be.equal('dead bronco'); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment