Sha256: bee387fe8c3b89531df9ad5e91129e0a161aa725a8fb4225176325f0ccc530d5

Contents?: true

Size: 1015 Bytes

Versions: 26

Compression:

Stored size: 1015 Bytes

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::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

26 entries across 26 versions & 1 rubygems

Version Path
medivo-0.1.24 spec/requests/labs_spec.rb
medivo-0.1.23 spec/requests/labs_spec.rb
medivo-0.1.22 spec/requests/labs_spec.rb
medivo-0.1.21 spec/requests/labs_spec.rb
medivo-0.1.20 spec/requests/labs_spec.rb
medivo-0.1.19 spec/requests/labs_spec.rb
medivo-0.1.18 spec/requests/labs_spec.rb
medivo-0.1.17 spec/requests/labs_spec.rb
medivo-0.1.16 spec/requests/labs_spec.rb
medivo-0.1.15 spec/requests/labs_spec.rb
medivo-0.1.14 spec/requests/labs_spec.rb
medivo-0.1.13 spec/requests/labs_spec.rb
medivo-0.1.12 spec/requests/labs_spec.rb
medivo-0.1.11 spec/requests/labs_spec.rb
medivo-0.1.10 spec/requests/labs_spec.rb
medivo-0.1.9 spec/requests/labs_spec.rb
medivo-0.1.8 spec/requests/labs_spec.rb
medivo-0.1.7 spec/requests/labs_spec.rb
medivo-0.1.6 spec/requests/labs_spec.rb
medivo-0.1.5 spec/requests/labs_spec.rb