Sha256: 8b33987cfb9a9dda5b62a2ceb0f0cc59ba509ffaf6eaf2bfb7af9159ed3142e0

Contents?: true

Size: 928 Bytes

Versions: 12

Compression:

Stored size: 928 Bytes

Contents

require './spec/spec_helper'

require 'time'

describe OpenHouse do
  subject do
    OpenHouse.new(
      'ResourceUri'=>"/v1/listings/20060412165917817933000000/openhouses/20101127153422574618000000",
      'Id'=>"20060412165917817933000000",
      'Date'=>"10/01/2010",
      'StartTime'=>"9:00 am",
      'EndTime'=>"12:00 pm"
    )
  end

  it "should respond to a few methods" do
    expect(subject.class).to respond_to(:find_by_listing_key)
  end

  context "/listings/<listing_id>/openhouses", :support do
    on_get_it "should get open house for a listing" do
      stub_auth_request
      stub_api_get('/listings/20060412165917817933000000/openhouses','listings/open_houses.json')
      houses = subject.class.find_by_listing_key('20060412165917817933000000')
      expect(houses).to be_an(Array)
      expect(houses.length).to eq(2)
      expect(houses.first.Id).to eq("20101127153422574618000000")
    end
  end

end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
spark_api-1.6.3 spec/unit/spark_api/models/open_house_spec.rb
spark_api-1.6.2 spec/unit/spark_api/models/open_house_spec.rb
spark_api-1.6.1 spec/unit/spark_api/models/open_house_spec.rb
spark_api-1.5.7 spec/unit/spark_api/models/open_house_spec.rb
spark_api-1.6.0 spec/unit/spark_api/models/open_house_spec.rb
spark_api-1.5.6 spec/unit/spark_api/models/open_house_spec.rb
spark_api-1.5.5 spec/unit/spark_api/models/open_house_spec.rb
spark_api-1.5.4 spec/unit/spark_api/models/open_house_spec.rb
spark_api-1.5.3 spec/unit/spark_api/models/open_house_spec.rb
spark_api-1.5.2 spec/unit/spark_api/models/open_house_spec.rb
spark_api-1.5.1 spec/unit/spark_api/models/open_house_spec.rb
spark_api-1.5.0 spec/unit/spark_api/models/open_house_spec.rb