Sha256: d3bc53abab2144bad42a54efa4921db3b26864b1ec44d2ac6cf29b4584563f61

Contents?: true

Size: 850 Bytes

Versions: 6

Compression:

Stored size: 850 Bytes

Contents

require 'spec_helper'

module Almanack::EventSource
  describe IcalFeed do
    it "accepts a URL" do
      IcalFeed.new("http://example.org/ical.ics")
    end

    describe "#events_between" do
      it "returns a list of events" do
        feed = IcalFeed.new('https://www.google.com/calendar/ical/61s2re9bfk01abmla4d17tojuo%40group.calendar.google.com/public/basic.ics')
        events = nil

        Timecop.freeze(2014, 4, 3) do
          VCR.use_cassette('google_calendar') do
            from = Time.now
            to = from + 30 * 24 * 60 * 60
            events = feed.events_between(from..to)
          end
        end

        start_dates = events.map(&:start_date)

        expect(events.length).to eq(15)
        expect(events).to all_have_properties(:title, :start_date, :end_date, :description, :location)
      end
    end

  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
almanack-1.0.3 spec/event_source/ical_feed_spec.rb
almanack-1.0.2 spec/event_source/ical_feed_spec.rb
almanack-1.0.1 spec/event_source/ical_feed_spec.rb
almanack-1.0.0 spec/event_source/ical_feed_spec.rb
almanack-1.0.0.pre1 spec/event_source/ical_feed_spec.rb
almanack-1.0.0.pre spec/event_source/ical_feed_spec.rb