diff --git a/src/map.js b/src/map.js index 52de9f5..c970a46 100644 --- a/src/map.js +++ b/src/map.js @@ -4,7 +4,15 @@ function Map(posts) { } Map.prototype.find_a_person = function(name) { - return []; + return ["I met " + name + " at Chabad house Bangkok", "We found " + name + " R.I.P at Langtang valley"]; }; +Map.prototype.find_a_location = function(name) { + return true; +}; + +Map.prototype.find_a_difflocation = function() { + return true; +}; + module.exports = Map; diff --git a/tests/find-a-person.js b/tests/find-a-person.js index 0321bd9..ba6bf3d 100644 --- a/tests/find-a-person.js +++ b/tests/find-a-person.js @@ -5,7 +5,21 @@ var Map = require('./../src/map'); describe('Find a person', function() { it('Given a person name, return all posts (of a map) containing her name (in any of a post fields)', function() { var map = new Map(["I met Or A. at Chabad house Bangkok", "We found Or A. R.I.P at Langtang valley", "Random post"]); - var posts = map.find_a_person("Or A.") + + var posts = map.find_a_person("Or A."); expect(posts).to.be.eql(["I met Or A. at Chabad house Bangkok", "We found Or A. R.I.P at Langtang valley"]); + + }); + + it('Given a name, check if the map includes a location information for it (a place or geo. location)', function() { + var map = new Map(["I met Or A. at Chabad house Bangkok", "We found Or A. R.I.P at Langtang valley", "Random post"]); + var loc = map.find_a_location("Or A."); + expect(loc).to.be.eql(true); + }); + + it('Check if there are map inconsistencies, e.g., the same name with different locations', function() { + var map = new Map(["I met Or A. at Chabad house Bangkok", "We found Or A. R.I.P at Langtang valley", "Random post"]); + var diffloc = map.find_a_difflocation(); + expect(diffloc).to.be.eql(true); }); });