diff --git a/test/data/address.json b/test/data/address.json new file mode 100644 index 0000000..e19c6c9 --- /dev/null +++ b/test/data/address.json @@ -0,0 +1,578 @@ +[ + { + "country": "Suriname", + "street": "Utica Avenue", + "state": "American Samoa", + "city": "Levant" + }, + { + "country": "Seychelles", + "street": "Ridgewood Place", + "state": "Alabama", + "city": "Venice" + }, + { + "country": "Tunisia", + "street": "Madison Street", + "state": "Nebraska", + "city": "Coyote" + }, + { + "country": "Bahamas", + "street": "Mill Road", + "state": "Iowa", + "city": "Sedley" + }, + { + "country": "Austria", + "street": "Falmouth Street", + "state": "West Virginia", + "city": "Sutton" + }, + { + "country": "Sudan", + "street": "Radde Place", + "state": "Kentucky", + "city": "Wyano" + }, + { + "country": "Dominican Republic", + "street": "Blake Court", + "state": "Delaware", + "city": "Albrightsville" + }, + { + "country": "South Africa", + "street": "Laurel Avenue", + "state": "Rhode Island", + "city": "Ernstville" + }, + { + "country": "Iceland", + "street": "Jay Street", + "state": "Indiana", + "city": "Hartsville/Hartley" + }, + { + "country": "American Samoa", + "street": "Sackett Street", + "state": "Maine", + "city": "Centerville" + }, + { + "country": "British Indian Ocean Territory", + "street": "Montague Street", + "state": "Puerto Rico", + "city": "Troy" + }, + { + "country": "Australia", + "street": "Wortman Avenue", + "state": "Michigan", + "city": "Sanford" + }, + { + "country": "Guam", + "street": "Green Street", + "state": "Nevada", + "city": "Crenshaw" + }, + { + "country": "Moldova", + "street": "Cameron Court", + "state": "Texas", + "city": "Indio" + }, + { + "country": "Bhutan", + "street": "Pioneer Street", + "state": "California", + "city": "Succasunna" + }, + { + "country": "Norfolk Island", + "street": "Powell Street", + "state": "New Jersey", + "city": "Townsend" + }, + { + "country": "Anguilla", + "street": "Elliott Place", + "state": "Alaska", + "city": "Lowgap" + }, + { + "country": "Cyprus", + "street": "Rochester Avenue", + "state": "Arizona", + "city": "Chapin" + }, + { + "country": "Estonia", + "street": "Kingston Avenue", + "state": "Palau", + "city": "Eastmont" + }, + { + "country": "Qatar", + "street": "Milton Street", + "state": "Wisconsin", + "city": "Oneida" + }, + { + "country": "Andorra", + "street": "Narrows Avenue", + "state": "Maryland", + "city": "Madaket" + }, + { + "country": "Cocos (Keeling Islands)", + "street": "Sunnyside Court", + "state": "Virginia", + "city": "Caroleen" + }, + { + "country": "Croatia (Hrvatska)", + "street": "Clarendon Road", + "state": "North Carolina", + "city": "Frizzleburg" + }, + { + "country": "Singapore", + "street": "Eaton Court", + "state": "Kansas", + "city": "Chautauqua" + }, + { + "country": "Niger", + "street": "Indiana Place", + "state": "Northern Mariana Islands", + "city": "Escondida" + }, + { + "country": "Sierra Leone", + "street": "Noll Street", + "state": "Tennessee", + "city": "Clayville" + }, + { + "country": "Somalia", + "street": "Harwood Place", + "state": "South Carolina", + "city": "Coalmont" + }, + { + "country": "Belgium", + "street": "Bayview Place", + "state": "Florida", + "city": "Ruffin" + }, + { + "country": "Samoa", + "street": "Lenox Road", + "state": "Missouri", + "city": "Wilsonia" + }, + { + "country": "Armenia", + "street": "Oceanview Avenue", + "state": "American Samoa", + "city": "Genoa" + }, + { + "country": "Poland", + "street": "Dobbin Street", + "state": "Alabama", + "city": "Kraemer" + }, + { + "country": "Djibouti", + "street": "Meeker Avenue", + "state": "Nebraska", + "city": "Veguita" + }, + { + "country": "Bangladesh", + "street": "Hendrickson Street", + "state": "Iowa", + "city": "Knowlton" + }, + { + "country": "Ecuador", + "street": "Guernsey Street", + "state": "West Virginia", + "city": "Ada" + }, + { + "country": "Mayotte", + "street": "Stryker Court", + "state": "Kentucky", + "city": "Brooktrails" + }, + { + "country": "Viet Nam", + "street": "Doone Court", + "state": "Delaware", + "city": "Graniteville" + }, + { + "country": "Bahrain", + "street": "Boardwalk ", + "state": "Rhode Island", + "city": "Marne" + }, + { + "country": "Nicaragua", + "street": "Jackson Place", + "state": "Indiana", + "city": "Gracey" + }, + { + "country": "Mozambique", + "street": "Mersereau Court", + "state": "Maine", + "city": "Thomasville" + }, + { + "country": "Argentina", + "street": "Lefferts Avenue", + "state": "Puerto Rico", + "city": "Guilford" + }, + { + "country": "Jamaica", + "street": "Hicks Street", + "state": "Michigan", + "city": "Harborton" + }, + { + "country": "Korea (North)", + "street": "Strauss Street", + "state": "Nevada", + "city": "Byrnedale" + }, + { + "country": "US Minor Outlying Islands", + "street": "Herkimer Street", + "state": "Texas", + "city": "Ilchester" + }, + { + "country": "Burundi", + "street": "Engert Avenue", + "state": "California", + "city": "Nash" + }, + { + "country": "Swaziland", + "street": "Beayer Place", + "state": "New Jersey", + "city": "Taft" + }, + { + "country": "Kyrgyzstan", + "street": "Henry Street", + "state": "Alaska", + "city": "Limestone" + }, + { + "country": "Pakistan", + "street": "Bay Street", + "state": "Arizona", + "city": "Brandermill" + }, + { + "country": "Barbados", + "street": "Bennet Court", + "state": "Palau", + "city": "Lund" + }, + { + "country": "Benin", + "street": "Lake Place", + "state": "Wisconsin", + "city": "Matthews" + }, + { + "country": "Saint Kitts and Nevis", + "street": "Agate Court", + "state": "Maryland", + "city": "Gulf" + }, + { + "country": "Tonga", + "street": "Cumberland Street", + "state": "Virginia", + "city": "Waukeenah" + }, + { + "country": "Belarus", + "street": "Calder Place", + "state": "North Carolina", + "city": "Newcastle" + }, + { + "country": "Senegal", + "street": "Johnson Street", + "state": "Kansas", + "city": "Haring" + }, + { + "country": "Jordan", + "street": "Haring Street", + "state": "Northern Mariana Islands", + "city": "Mahtowa" + }, + { + "country": "Saudi Arabia", + "street": "Bainbridge Street", + "state": "Tennessee", + "city": "Southmont" + }, + { + "country": "Malaysia", + "street": "Village Road", + "state": "South Carolina", + "city": "Ventress" + }, + { + "country": "New Caledonia", + "street": "Matthews Place", + "state": "Florida", + "city": "Bartley" + }, + { + "country": "Mauritius", + "street": "River Street", + "state": "Missouri", + "city": "Makena" + }, + { + "country": "Albania", + "street": "Osborn Street", + "state": "American Samoa", + "city": "Sandston" + }, + { + "country": "France", + "street": "Quay Street", + "state": "Alabama", + "city": "Madrid" + }, + { + "country": "Cook Islands", + "street": "Ridge Court", + "state": "Nebraska", + "city": "Harrodsburg" + }, + { + "country": "Cameroon", + "street": "Willoughby Street", + "state": "Iowa", + "city": "Rosine" + }, + { + "country": "Congo", + "street": "Bragg Court", + "state": "West Virginia", + "city": "Riceville" + }, + { + "country": "Greenland", + "street": "Bank Street", + "state": "Kentucky", + "city": "Spelter" + }, + { + "country": "Iraq", + "street": "Church Avenue", + "state": "Delaware", + "city": "Grahamtown" + }, + { + "country": "Rwanda", + "street": "Harbor Court", + "state": "Rhode Island", + "city": "Yettem" + }, + { + "country": "Puerto Rico", + "street": "Monroe Place", + "state": "Indiana", + "city": "Kenwood" + }, + { + "country": "San Marino", + "street": "Devon Avenue", + "state": "Maine", + "city": "Ironton" + }, + { + "country": "St. Helena", + "street": "Bergen Court", + "state": "Puerto Rico", + "city": "Swartzville" + }, + { + "country": "Mauritania", + "street": "Lorimer Street", + "state": "Michigan", + "city": "Crucible" + }, + { + "country": "Syria", + "street": "Johnson Avenue", + "state": "Nevada", + "city": "Avoca" + }, + { + "country": "Portugal", + "street": "Montauk Court", + "state": "Texas", + "city": "Diaperville" + }, + { + "country": "Angola", + "street": "Arlington Avenue", + "state": "California", + "city": "Waikele" + }, + { + "country": "Algeria", + "street": "Kensington Street", + "state": "New Jersey", + "city": "Graball" + }, + { + "country": "Georgia", + "street": "Olive Street", + "state": "Alaska", + "city": "Rodman" + }, + { + "country": "Brunei Darussalam", + "street": "Stockton Street", + "state": "Arizona", + "city": "Bridgetown" + }, + { + "country": "Kazakhstan", + "street": "National Drive", + "state": "Palau", + "city": "Bennett" + }, + { + "country": "Marshall Islands", + "street": "Hewes Street", + "state": "Wisconsin", + "city": "Loma" + }, + { + "country": "Tajikistan", + "street": "Henderson Walk", + "state": "Maryland", + "city": "Summerset" + }, + { + "country": "Uzbekistan", + "street": "Beverley Road", + "state": "Virginia", + "city": "Draper" + }, + { + "country": "Bulgaria", + "street": "Everett Avenue", + "state": "North Carolina", + "city": "Kohatk" + }, + { + "country": "Indonesia", + "street": "Bay Avenue", + "state": "Kansas", + "city": "Loretto" + }, + { + "country": "Israel", + "street": "Kingsland Avenue", + "state": "Northern Mariana Islands", + "city": "Gardners" + }, + { + "country": "Madagascar", + "street": "Grafton Street", + "state": "Tennessee", + "city": "Dodge" + }, + { + "country": "Papua New Guinea", + "street": "Beaver Street", + "state": "South Carolina", + "city": "Brutus" + }, + { + "country": "Ghana", + "street": "Nolans Lane", + "state": "Florida", + "city": "Richford" + }, + { + "country": "Slovak Republic", + "street": "Crooke Avenue", + "state": "Missouri", + "city": "Cobbtown" + }, + { + "country": "Yemen", + "street": "Bergen Avenue", + "state": "American Samoa", + "city": "Hasty" + }, + { + "country": "Switzerland", + "street": "Oakland Place", + "state": "Alabama", + "city": "Darrtown" + }, + { + "country": "Liberia", + "street": "Bokee Court", + "state": "Nebraska", + "city": "Bradenville" + }, + { + "country": "Cape Verde", + "street": "Times Placez", + "state": "Iowa", + "city": "Cotopaxi" + }, + { + "country": "Kuwait", + "street": "Lewis Avenue", + "state": "West Virginia", + "city": "Russellville" + }, + { + "country": "French Polynesia", + "street": "Kenilworth Place", + "state": "Kentucky", + "city": "Wright" + }, + { + "country": "Mexico", + "street": "Juliana Place", + "state": "Delaware", + "city": "Comptche" + }, + { + "country": "Malta", + "street": "Danforth Street", + "state": "Rhode Island", + "city": "Vicksburg" + }, + { + "country": "Monaco", + "street": "Hudson Avenue", + "state": "Indiana", + "city": "Reinerton" + } +] diff --git a/test/data/company.json b/test/data/company.json index 1d41c92..317231c 100644 --- a/test/data/company.json +++ b/test/data/company.json @@ -1,770 +1,194 @@ [{ - "name": "QUORDATE", - "address": { - "city": "Levant", - "state": "American Samoa", - "street": "Utica Avenue", - "country": "Suriname" - } - },{ - "name": "SENMAO", - "address": { - "city": "Venice", - "state": "Alabama", - "street": "Ridgewood Place", - "country": "Seychelles" - } - },{ - "name": "TRIPSCH", - "address": { - "city": "Coyote", - "state": "Nebraska", - "street": "Madison Street", - "country": "Tunisia" - } - },{ - "name": "TUBESYS", - "address": { - "city": "Sedley", - "state": "Iowa", - "street": "Mill Road", - "country": "Bahamas" - } - },{ - "name": "FLUM", - "address": { - "city": "Sutton", - "state": "West Virginia", - "street": "Falmouth Street", - "country": "Austria" - } - },{ - "name": "OTHERWAY", - "address": { - "city": "Wyano", - "state": "Kentucky", - "street": "Radde Place", - "country": "Sudan" - } - },{ - "name": "METROZ", - "address": { - "city": "Albrightsville", - "state": "Delaware", - "street": "Blake Court", - "country": "Dominican Republic" - } - },{ - "name": "UPDAT", - "address": { - "city": "Ernstville", - "state": "Rhode Island", - "street": "Laurel Avenue", - "country": "South Africa" - } - },{ - "name": "BOVIS", - "address": { - "city": "Hartsville/Hartley", - "state": "Indiana", - "street": "Jay Street", - "country": "Iceland" - } - },{ - "name": "QOT", - "address": { - "city": "Centerville", - "state": "Maine", - "street": "Sackett Street", - "country": "American Samoa" - } - },{ - "name": "APPLIDEC", - "address": { - "city": "Troy", - "state": "Puerto Rico", - "street": "Montague Street", - "country": "British Indian Ocean Territory" - } - },{ - "name": "RODEMCO", - "address": { - "city": "Sanford", - "state": "Michigan", - "street": "Wortman Avenue", - "country": "Australia" - } - },{ - "name": "UTARIAN", - "address": { - "city": "Crenshaw", - "state": "Nevada", - "street": "Green Street", - "country": "Guam" - } - },{ - "name": "ACCUPRINT", - "address": { - "city": "Indio", - "state": "Texas", - "street": "Cameron Court", - "country": "Moldova" - } - },{ - "name": "ICOLOGY", - "address": { - "city": "Succasunna", - "state": "California", - "street": "Pioneer Street", - "country": "Bhutan" - } - },{ - "name": "ZENTIA", - "address": { - "city": "Townsend", - "state": "New Jersey", - "street": "Powell Street", - "country": "Norfolk Island" - } - },{ - "name": "UNQ", - "address": { - "city": "Lowgap", - "state": "Alaska", - "street": "Elliott Place", - "country": "Anguilla" - } - },{ - "name": "QUARMONY", - "address": { - "city": "Chapin", - "state": "Arizona", - "street": "Rochester Avenue", - "country": "Cyprus" - } - },{ - "name": "APEX", - "address": { - "city": "Eastmont", - "state": "Palau", - "street": "Kingston Avenue", - "country": "Estonia" - } - },{ - "name": "SPHERIX", - "address": { - "city": "Oneida", - "state": "Wisconsin", - "street": "Milton Street", - "country": "Qatar" - } - },{ - "name": "IDEGO", - "address": { - "city": "Madaket", - "state": "Maryland", - "street": "Narrows Avenue", - "country": "Andorra" - } - },{ - "name": "BALUBA", - "address": { - "city": "Caroleen", - "state": "Virginia", - "street": "Sunnyside Court", - "country": "Cocos (Keeling Islands)" - } - },{ - "name": "XYQAG", - "address": { - "city": "Frizzleburg", - "state": "North Carolina", - "street": "Clarendon Road", - "country": "Croatia (Hrvatska)" - } - },{ - "name": "HALAP", - "address": { - "city": "Chautauqua", - "state": "Kansas", - "street": "Eaton Court", - "country": "Singapore" - } - },{ - "name": "ZEDALIS", - "address": { - "city": "Escondida", - "state": "Northern Mariana Islands", - "street": "Indiana Place", - "country": "Niger" - } - },{ - "name": "VELOS", - "address": { - "city": "Clayville", - "state": "Tennessee", - "street": "Noll Street", - "country": "Sierra Leone" - } - },{ - "name": "VINCH", - "address": { - "city": "Coalmont", - "state": "South Carolina", - "street": "Harwood Place", - "country": "Somalia" - } - },{ - "name": "KOOGLE", - "address": { - "city": "Ruffin", - "state": "Florida", - "street": "Bayview Place", - "country": "Belgium" - } - },{ - "name": "BARKARAMA", - "address": { - "city": "Wilsonia", - "state": "Missouri", - "street": "Lenox Road", - "country": "Samoa" - } - },{ - "name": "GEOFORM", - "address": { - "city": "Genoa", - "state": "American Samoa", - "street": "Oceanview Avenue", - "country": "Armenia" - } - },{ - "name": "GAZAK", - "address": { - "city": "Kraemer", - "state": "Alabama", - "street": "Dobbin Street", - "country": "Poland" - } - },{ - "name": "IMMUNICS", - "address": { - "city": "Veguita", - "state": "Nebraska", - "street": "Meeker Avenue", - "country": "Djibouti" - } - },{ - "name": "VIAGREAT", - "address": { - "city": "Knowlton", - "state": "Iowa", - "street": "Hendrickson Street", - "country": "Bangladesh" - } - },{ - "name": "ZIGGLES", - "address": { - "city": "Ada", - "state": "West Virginia", - "street": "Guernsey Street", - "country": "Ecuador" - } - },{ - "name": "MEDIOT", - "address": { - "city": "Brooktrails", - "state": "Kentucky", - "street": "Stryker Court", - "country": "Mayotte" - } - },{ - "name": "UBERLUX", - "address": { - "city": "Graniteville", - "state": "Delaware", - "street": "Doone Court", - "country": "Viet Nam" - } - },{ - "name": "KIOSK", - "address": { - "city": "Marne", - "state": "Rhode Island", - "street": "Boardwalk ", - "country": "Bahrain" - } - },{ - "name": "OVIUM", - "address": { - "city": "Gracey", - "state": "Indiana", - "street": "Jackson Place", - "country": "Nicaragua" - } - },{ - "name": "CORECOM", - "address": { - "city": "Thomasville", - "state": "Maine", - "street": "Mersereau Court", - "country": "Mozambique" - } - },{ - "name": "COSMETEX", - "address": { - "city": "Guilford", - "state": "Puerto Rico", - "street": "Lefferts Avenue", - "country": "Argentina" - } - },{ - "name": "IMAGINART", - "address": { - "city": "Harborton", - "state": "Michigan", - "street": "Hicks Street", - "country": "Jamaica" - } - },{ - "name": "GEEKWAGON", - "address": { - "city": "Byrnedale", - "state": "Nevada", - "street": "Strauss Street", - "country": "Korea (North)" - } - },{ - "name": "TEMORAK", - "address": { - "city": "Ilchester", - "state": "Texas", - "street": "Herkimer Street", - "country": "US Minor Outlying Islands" - } - },{ - "name": "QUONK", - "address": { - "city": "Nash", - "state": "California", - "street": "Engert Avenue", - "country": "Burundi" - } - },{ - "name": "XIIX", - "address": { - "city": "Taft", - "state": "New Jersey", - "street": "Beayer Place", - "country": "Swaziland" - } - },{ - "name": "PROSELY", - "address": { - "city": "Limestone", - "state": "Alaska", - "street": "Henry Street", - "country": "Kyrgyzstan" - } - },{ - "name": "BUZZOPIA", - "address": { - "city": "Brandermill", - "state": "Arizona", - "street": "Bay Street", - "country": "Pakistan" - } - },{ - "name": "VANTAGE", - "address": { - "city": "Lund", - "state": "Palau", - "street": "Bennet Court", - "country": "Barbados" - } - },{ - "name": "GEEKNET", - "address": { - "city": "Matthews", - "state": "Wisconsin", - "street": "Lake Place", - "country": "Benin" - } - },{ - "name": "UNI", - "address": { - "city": "Gulf", - "state": "Maryland", - "street": "Agate Court", - "country": "Saint Kitts and Nevis" - } - },{ - "name": "ASSURITY", - "address": { - "city": "Waukeenah", - "state": "Virginia", - "street": "Cumberland Street", - "country": "Tonga" - } - },{ - "name": "OBONES", - "address": { - "city": "Newcastle", - "state": "North Carolina", - "street": "Calder Place", - "country": "Belarus" - } - },{ - "name": "CINCYR", - "address": { - "city": "Haring", - "state": "Kansas", - "street": "Johnson Street", - "country": "Senegal" - } - },{ - "name": "DANCERITY", - "address": { - "city": "Mahtowa", - "state": "Northern Mariana Islands", - "street": "Haring Street", - "country": "Jordan" - } - },{ - "name": "VOIPA", - "address": { - "city": "Southmont", - "state": "Tennessee", - "street": "Bainbridge Street", - "country": "Saudi Arabia" - } - },{ - "name": "ASSITIA", - "address": { - "city": "Ventress", - "state": "South Carolina", - "street": "Village Road", - "country": "Malaysia" - } - },{ - "name": "CORPORANA", - "address": { - "city": "Bartley", - "state": "Florida", - "street": "Matthews Place", - "country": "New Caledonia" - } - },{ - "name": "CODACT", - "address": { - "city": "Makena", - "state": "Missouri", - "street": "River Street", - "country": "Mauritius" - } - },{ - "name": "FUTURITY", - "address": { - "city": "Sandston", - "state": "American Samoa", - "street": "Osborn Street", - "country": "Albania" - } - },{ - "name": "QUANTASIS", - "address": { - "city": "Madrid", - "state": "Alabama", - "street": "Quay Street", - "country": "France" - } - },{ - "name": "ANIMALIA", - "address": { - "city": "Harrodsburg", - "state": "Nebraska", - "street": "Ridge Court", - "country": "Cook Islands" - } - },{ - "name": "LEXICONDO", - "address": { - "city": "Rosine", - "state": "Iowa", - "street": "Willoughby Street", - "country": "Cameroon" - } - },{ - "name": "IDEALIS", - "address": { - "city": "Riceville", - "state": "West Virginia", - "street": "Bragg Court", - "country": "Congo" - } - },{ - "name": "SAVVY", - "address": { - "city": "Spelter", - "state": "Kentucky", - "street": "Bank Street", - "country": "Greenland" - } - },{ - "name": "BEDLAM", - "address": { - "city": "Grahamtown", - "state": "Delaware", - "street": "Church Avenue", - "country": "Iraq" - } - },{ - "name": "OATFARM", - "address": { - "city": "Yettem", - "state": "Rhode Island", - "street": "Harbor Court", - "country": "Rwanda" - } - },{ - "name": "ORBOID", - "address": { - "city": "Kenwood", - "state": "Indiana", - "street": "Monroe Place", - "country": "Puerto Rico" - } - },{ - "name": "ZYTRAC", - "address": { - "city": "Ironton", - "state": "Maine", - "street": "Devon Avenue", - "country": "San Marino" - } - },{ - "name": "RODEOCEAN", - "address": { - "city": "Swartzville", - "state": "Puerto Rico", - "street": "Bergen Court", - "country": "St. Helena" - } - },{ - "name": "FANGOLD", - "address": { - "city": "Crucible", - "state": "Michigan", - "street": "Lorimer Street", - "country": "Mauritania" - } - },{ - "name": "CINASTER", - "address": { - "city": "Avoca", - "state": "Nevada", - "street": "Johnson Avenue", - "country": "Syria" - } - },{ - "name": "SEQUITUR", - "address": { - "city": "Diaperville", - "state": "Texas", - "street": "Montauk Court", - "country": "Portugal" - } - },{ - "name": "OVOLO", - "address": { - "city": "Waikele", - "state": "California", - "street": "Arlington Avenue", - "country": "Angola" - } - },{ - "name": "COMTENT", - "address": { - "city": "Graball", - "state": "New Jersey", - "street": "Kensington Street", - "country": "Algeria" - } - },{ - "name": "UNDERTAP", - "address": { - "city": "Rodman", - "state": "Alaska", - "street": "Olive Street", - "country": "Georgia" - } - },{ - "name": "FARMEX", - "address": { - "city": "Bridgetown", - "state": "Arizona", - "street": "Stockton Street", - "country": "Brunei Darussalam" - } - },{ - "name": "EXIAND", - "address": { - "city": "Bennett", - "state": "Palau", - "street": "National Drive", - "country": "Kazakhstan" - } - },{ - "name": "EARTHMARK", - "address": { - "city": "Loma", - "state": "Wisconsin", - "street": "Hewes Street", - "country": "Marshall Islands" - } - },{ - "name": "AUTOMON", - "address": { - "city": "Summerset", - "state": "Maryland", - "street": "Henderson Walk", - "country": "Tajikistan" - } - },{ - "name": "CENTREGY", - "address": { - "city": "Draper", - "state": "Virginia", - "street": "Beverley Road", - "country": "Uzbekistan" - } - },{ - "name": "OLYMPIX", - "address": { - "city": "Kohatk", - "state": "North Carolina", - "street": "Everett Avenue", - "country": "Bulgaria" - } - },{ - "name": "PREMIANT", - "address": { - "city": "Loretto", - "state": "Kansas", - "street": "Bay Avenue", - "country": "Indonesia" - } - },{ - "name": "CEPRENE", - "address": { - "city": "Gardners", - "state": "Northern Mariana Islands", - "street": "Kingsland Avenue", - "country": "Israel" - } - },{ - "name": "EXOTERIC", - "address": { - "city": "Dodge", - "state": "Tennessee", - "street": "Grafton Street", - "country": "Madagascar" - } - },{ - "name": "COMTRAK", - "address": { - "city": "Brutus", - "state": "South Carolina", - "street": "Beaver Street", - "country": "Papua New Guinea" - } - },{ - "name": "INRT", - "address": { - "city": "Richford", - "state": "Florida", - "street": "Nolans Lane", - "country": "Ghana" - } - },{ - "name": "INQUALA", - "address": { - "city": "Cobbtown", - "state": "Missouri", - "street": "Crooke Avenue", - "country": "Slovak Republic" - } - },{ - "name": "QUANTALIA", - "address": { - "city": "Hasty", - "state": "American Samoa", - "street": "Bergen Avenue", - "country": "Yemen" - } - },{ - "name": "MOREGANIC", - "address": { - "city": "Darrtown", - "state": "Alabama", - "street": "Oakland Place", - "country": "Switzerland" - } - },{ - "name": "ENERFORCE", - "address": { - "city": "Bradenville", - "state": "Nebraska", - "street": "Bokee Court", - "country": "Liberia" - } - },{ - "name": "ISOTERNIA", - "address": { - "city": "Cotopaxi", - "state": "Iowa", - "street": "Times Placez", - "country": "Cape Verde" - } - },{ - "name": "ORBIXTAR", - "address": { - "city": "Russellville", - "state": "West Virginia", - "street": "Lewis Avenue", - "country": "Kuwait" - } - },{ - "name": "WAAB", - "address": { - "city": "Wright", - "state": "Kentucky", - "street": "Kenilworth Place", - "country": "French Polynesia" - } - },{ - "name": "FLEXIGEN", - "address": { - "city": "Comptche", - "state": "Delaware", - "street": "Juliana Place", - "country": "Mexico" - } - },{ - "name": "KEGULAR", - "address": { - "city": "Vicksburg", - "state": "Rhode Island", - "street": "Danforth Street", - "country": "Malta" - } - },{ - "name": "KINETICA", - "address": { - "city": "Reinerton", - "state": "Indiana", - "street": "Hudson Avenue", - "country": "Monaco" - } + "name": "QUORDATE" + },{ + "name": "SENMAO" + },{ + "name": "TRIPSCH" + },{ + "name": "TUBESYS" + },{ + "name": "FLUM" + },{ + "name": "OTHERWAY" + },{ + "name": "METROZ" + },{ + "name": "UPDAT" + },{ + "name": "BOVIS" + },{ + "name": "QOT" + },{ + "name": "APPLIDEC" + },{ + "name": "RODEMCO" + },{ + "name": "UTARIAN" + },{ + "name": "ACCUPRINT" + },{ + "name": "ICOLOGY" + },{ + "name": "ZENTIA" + },{ + "name": "UNQ" + },{ + "name": "QUARMONY" + },{ + "name": "APEX" + },{ + "name": "SPHERIX" + },{ + "name": "IDEGO" + },{ + "name": "BALUBA" + },{ + "name": "XYQAG" + },{ + "name": "HALAP" + },{ + "name": "ZEDALIS" + },{ + "name": "VELOS" + },{ + "name": "VINCH" + },{ + "name": "KOOGLE" + },{ + "name": "BARKARAMA" + },{ + "name": "GEOFORM" + },{ + "name": "GAZAK" + },{ + "name": "IMMUNICS" + },{ + "name": "VIAGREAT" + },{ + "name": "ZIGGLES" + },{ + "name": "MEDIOT" + },{ + "name": "UBERLUX" + },{ + "name": "KIOSK" + },{ + "name": "OVIUM" + },{ + "name": "CORECOM" + },{ + "name": "COSMETEX" + },{ + "name": "IMAGINART" + },{ + "name": "GEEKWAGON" + },{ + "name": "TEMORAK" + },{ + "name": "QUONK" + },{ + "name": "XIIX" + },{ + "name": "PROSELY" + },{ + "name": "BUZZOPIA" + },{ + "name": "VANTAGE" + },{ + "name": "GEEKNET" + },{ + "name": "UNI" + },{ + "name": "ASSURITY" + },{ + "name": "OBONES" + },{ + "name": "CINCYR" + },{ + "name": "DANCERITY" + },{ + "name": "VOIPA" + },{ + "name": "ASSITIA" + },{ + "name": "CORPORANA" + },{ + "name": "CODACT" + },{ + "name": "FUTURITY" + },{ + "name": "QUANTASIS" + },{ + "name": "ANIMALIA" + },{ + "name": "LEXICONDO" + },{ + "name": "IDEALIS" + },{ + "name": "SAVVY" + },{ + "name": "BEDLAM" + },{ + "name": "OATFARM" + },{ + "name": "ORBOID" + },{ + "name": "ZYTRAC" + },{ + "name": "RODEOCEAN" + },{ + "name": "FANGOLD" + },{ + "name": "CINASTER" + },{ + "name": "SEQUITUR" + },{ + "name": "OVOLO" + },{ + "name": "COMTENT" + },{ + "name": "UNDERTAP" + },{ + "name": "FARMEX" + },{ + "name": "EXIAND" + },{ + "name": "EARTHMARK" + },{ + "name": "AUTOMON" + },{ + "name": "CENTREGY" + },{ + "name": "OLYMPIX" + },{ + "name": "PREMIANT" + },{ + "name": "CEPRENE" + },{ + "name": "EXOTERIC" + },{ + "name": "COMTRAK" + },{ + "name": "INRT" + },{ + "name": "INQUALA" + },{ + "name": "QUANTALIA" + },{ + "name": "MOREGANIC" + },{ + "name": "ENERFORCE" + },{ + "name": "ISOTERNIA" + },{ + "name": "ORBIXTAR" + },{ + "name": "WAAB" + },{ + "name": "FLEXIGEN" + },{ + "name": "KEGULAR" + },{ + "name": "KINETICA" } -] \ No newline at end of file +] diff --git a/test/data/model.js b/test/data/model.js index 07c5558..a7c6b66 100644 --- a/test/data/model.js +++ b/test/data/model.js @@ -4,6 +4,8 @@ var rethink = require( 'thinky' )({db:'tastypie'}) , Tag , Post , Shoe + , Address + ; Tag = rethink.createModel('tastypie_tag',{ @@ -12,6 +14,13 @@ Tag = rethink.createModel('tastypie_tag',{ pk:'name' }) +Address = rethink.createModel('tastypie_address',{ + state: type.string(), + city: type.string(), + street: type.string(), + country: type.string(), + company_id: type.string() +}); Shoe = rethink.createModel('tastypie_shoe',{ brand:type.string().required() @@ -30,13 +39,7 @@ Post = rethink.createModel('tastypie_post',{ var Company = rethink.createModel('tastypie_company',{ name: type.string(), - user_id: type.string(), - address:{ - state: type.string(), - city: type.string(), - street: type.string(), - country: type.string() - } + user_id: type.string() }) @@ -71,12 +74,11 @@ User = rethink.createModel('tastypie_user',{ User.pre('save',function( next ){ - this.registered = new Date( this.registered ) next(); }) User.r = rethink.r - +Company.hasOne(Address,'address','id','company_id'); User.hasOne( Company, 'company','id','user_id') User.hasMany(Tag, 'tags', 'id', 'user_id'); User.hasMany(Post, 'posts', 'id', 'user_id'); @@ -88,3 +90,4 @@ module.exports.Tag = Tag module.exports.Company = Company; module.exports.Post = Post; module.exports.Shoe = Shoe; +module.exports.Address = Address; diff --git a/test/resource.http.spec.js b/test/resource.http.spec.js index 3e003f8..4918e7f 100644 --- a/test/resource.http.spec.js +++ b/test/resource.http.spec.js @@ -100,6 +100,7 @@ describe('RethinkResource', function( ){ Promise.all([ Model.Tag.delete(), Model.Company.delete(), + Model.Address.delete(), Model.delete() ]) .then(function(){ @@ -139,7 +140,7 @@ describe('RethinkResource', function( ){ it('should accurately parse data', function(done){ var data = require('./data/test.json'); delete data[0].id; - + server.inject({ method:'post' ,url:'/api/rethink/test'