spec/requests/labs_spec.rb in medivo-0.0.1 vs spec/requests/labs_spec.rb in medivo-0.0.2

- old
+ new

@@ -13,19 +13,20 @@ stub(Medivo::ZipCode).find_by_zip_code(@zip_code) { BeverlyHillsZipCode } stub(Medivo::Lab).findLabs(@zip_code) { [BeverlyHillsLab1, BeverlyHillsLab2] } end it "returns lab and zip data" do - visit Medivo::Engine.routes.url_helpers.data_labs_path(@zip_code) - # can't seem to get json back .. just html .. but it works in rails server just fine' - #p page.body - JSON.parse(page.body)#.should = [BeverlyHillsLab1, BeverlyHillsLab2] + visit Medivo::Engine.routes.url_helpers.data_labs_path :zip_code => @zip_code + # can't seem to get json back .. just html .. but it works in rails server just fine + # so testing for the string will have to do for now + page.body.should match /#{BeverlyHillsLab1.name}/i + page.body.should match /#{BeverlyHillsLab2.name}/i end it "shows search results on the map", :js=>true, :driver=>:selenium_chrome do visit search_labs_path(:zip_code=>@zip_code) - p page.body - sleep 14 + page.body.should match /465 N ROXBURY DR STE 715, BEVERLY HILLS, CA/i + page.body.should match /8737 BEVERLY BLVD STE 401, LOS ANGELES, CA/i end end end