Sha256: 3e9409fe9a3a82fd9b7c420c48f14811c4a2dd5c48d8f6878a1c704aae25c029
Contents?: true
Size: 1.07 KB
Versions: 5
Compression:
Stored size: 1.07 KB
Contents
require 'spec_helper' describe 'LabController' do before do WebMock.allow_net_connect! end describe "showing lab list and map" do before do @zip_code = "90210" #stub(Medivo::ZipCode).find_by_zip_code(@zip_code) { BeverlyHillsZipCode } stub(Medivo::Lab).findLabs(@zip_code) { [BeverlyHillsLab1, BeverlyHillsLab2] } end it "/labs/data returns lab and zip data as json" do 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 "/labs/search shows search results on the map and list", :js=>true, :driver=>:selenium_chrome do visit search_labs_path :zip_code=>@zip_code 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
Version data entries
5 entries across 5 versions & 1 rubygems