Sha256: b4986dfc3c31f6fe89280101785556837c6a7f6f43fad22b9f0d46ddcd32b57a

Contents?: true

Size: 1016 Bytes

Versions: 12

Compression:

Stored size: 1016 Bytes

Contents

require './spec/spec_helper'

describe RentalCalendar do

  describe "/listings/<listing_id>/rentalcalendar", :support do
    before do
      stub_auth_request
      stub_api_get('/listings/1234/rentalcalendar','listings/rental_calendar.json')
    end

    on_get_it "should get an array of rental calendars" do
      p = RentalCalendar.find_by_listing_key('1234')
      expect(p).to be_an(Array)
      expect(p.length).to eq(2)
    end

  end
  
  describe "test include_date method" do
    it "knows about included dates" do
      cal = RentalCalendar.new
      cal.StartDate = Date.parse("2012-07-12")
      cal.EndDate = Date.parse("2012-07-18")
      expect(cal.include_date?(Date.parse("2012-06-01"))).to be false
      expect(cal.include_date?(Date.parse("2012-07-12"))).to be true
      expect(cal.include_date?(Date.parse("2012-07-15"))).to be true
      expect(cal.include_date?(Date.parse("2012-07-18"))).to be true
      expect(cal.include_date?(Date.parse("2012-08-01"))).to be false
    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/rental_calendar_spec.rb
spark_api-1.6.2 spec/unit/spark_api/models/rental_calendar_spec.rb
spark_api-1.6.1 spec/unit/spark_api/models/rental_calendar_spec.rb
spark_api-1.5.7 spec/unit/spark_api/models/rental_calendar_spec.rb
spark_api-1.6.0 spec/unit/spark_api/models/rental_calendar_spec.rb
spark_api-1.5.6 spec/unit/spark_api/models/rental_calendar_spec.rb
spark_api-1.5.5 spec/unit/spark_api/models/rental_calendar_spec.rb
spark_api-1.5.4 spec/unit/spark_api/models/rental_calendar_spec.rb
spark_api-1.5.3 spec/unit/spark_api/models/rental_calendar_spec.rb
spark_api-1.5.2 spec/unit/spark_api/models/rental_calendar_spec.rb
spark_api-1.5.1 spec/unit/spark_api/models/rental_calendar_spec.rb
spark_api-1.5.0 spec/unit/spark_api/models/rental_calendar_spec.rb