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