<commit_before>var vumigo = require('vumigo_v02');
var AppTester = vumigo.AppTester;
var LocationApp = require('../lib/openstreetmap').LocationApp;
var location = require('../../lib');
var OpenStreetMap = location.OpenStreetMap;

describe("OpenStreetMap example", function() {
    var app;
    var tester;
    var locations;

    beforeEach(function(){
        app = new LocationApp();
        tester = new AppTester(app);
        locations = [];

        locations.push({
            query: "Example Street",
            response_data: [
                {
                    display_name: "Example Street, Suburb",
                    geometry: {
                        location:{
                            latitude: '3.1415926535',
                            longitude: '2.7182818284'
                        }
                    }
                },
                {
                     display_name: "Another Street, Suburb",
                     geometry: {
                         location: {
                             latitude: '2.7182818284',
                             longitude: '3.1415926535'
                         }
                     }
                }
            ],
        });

        locations.push({
            query: "Single Street",
            response_data: [
                {
                    display_name: "Single Street, Suburb",
                    geometry: {
                        location:{
                            latitude: '1.4142135623',
                            longitude: '1.6180339887'
                        }
                    }
                },
            ],
        });

        tester
            .setup.config.app({
                name: 'test_app'
            })
            .setup(function(api) {
                locations.forEach(function(location) {
                    var f = OpenStreetMap.fixture(location);
                    console.log(f);
                    api.http.fixtures.add(f);
                });
            });
    });

    describe("When the user starts a session", function() {
        it("should ask the user for a location", function() {
            return tester
                .start()
                .check.interaction({
                    state: 'states:start',
                    reply: [
                        "Welcome to the location app.",
                        "What is your current address?"
                    ].join('\n')
                })
                .run();
        });
    });

    describe("When the user enters a location prompt with multiple results", function() {
        it("should ask the user to refine their choice", function() {
            return tester<commit_msg>Remove debug logging.<commit_after>var vumigo = require('vumigo_v02');
var AppTester = vumigo.AppTester;
var LocationApp = require('../lib/openstreetmap').LocationApp;
var location = require('../../lib');
var OpenStreetMap = location.OpenStreetMap;

describe("OpenStreetMap example", function() {
    var app;
    var tester;
    var locations;

    beforeEach(function(){
        app = new LocationApp();
        tester = new AppTester(app);
        locations = [];

        locations.push({
            query: "Example Street",
            response_data: [
                {
                    display_name: "Example Street, Suburb",
                    geometry: {
                        location:{
                            latitude: '3.1415926535',
                            longitude: '2.7182818284'
                        }
                    }
                },
                {
                     display_name: "Another Street, Suburb",
                     geometry: {
                         location: {
                             latitude: '2.7182818284',
                             longitude: '3.1415926535'
                         }
                     }
                }
            ],
        });

        locations.push({
            query: "Single Street",
            response_data: [
                {
                    display_name: "Single Street, Suburb",
                    geometry: {
                        location:{
                            latitude: '1.4142135623',
                            longitude: '1.6180339887'
                        }
                    }
                },
            ],
        });

        tester
            .setup.config.app({
                name: 'test_app'
            })
            .setup(function(api) {
                locations.forEach(function(location) {
                    api.http.fixtures.add(OpenStreetMap.fixture(location));
                });
            });
    });

    describe("When the user starts a session", function() {
        it("should ask the user for a location", function() {
            return tester
                .start()
                .check.interaction({
                    state: 'states:start',
                    reply: [
                        "Welcome to the location app.",
                        "What is your current address?"
                    ].join('\n')
                })
                .run();
        });
    });

    describe("When the user enters a location prompt with multiple results", function() {
        it("should ask the user to refine their choice", function() {
            return tester
{'fraction_non_alphanumeric': 0.10046598322460391, 'fraction_numerical': 0.025349487418452936, 'mean_word_length': 0.9903560830860534, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3611064', 'n_tokens_mistral': 1378, 'n_tokens_neox': 1193, 'n_words': 275}