Sha256: 2b5f88c550ae7c0fa759f061d27d443dc88d80f333a561b92ad2893ce8bd38fc

Contents?: true

Size: 1.16 KB

Versions: 2

Compression:

Stored size: 1.16 KB

Contents

require 'spec_helper'

describe "Viewing a calendar", :feature do
  before { Almanack.reset! }

  it "displays all upcoming events" do
    Almanack.config.add_events [
      { title: "Hogswatch" },
      { title: "Soul Cake Tuesday" },
      { title: "Eve of Small Gods" },
    ]

    get "/"

    expect(last_response).to have_event_on_page("Hogswatch")
    expect(last_response).to have_event_on_page("Soul Cake Tuesday")
    expect(last_response).to have_event_on_page("Eve of Small Gods")
  end

  it "displays events from an iCal feed" do
    Almanack.config.add_ical_feed "https://www.google.com/calendar/ical/61s2re9bfk01abmla4d17tojuo%40group.calendar.google.com/public/basic.ics"
    
    Timecop.freeze(2014, 4, 3) do
      VCR.use_cassette('google_calendar') do
        get "/"
      end
    end

    expect(last_response).to have_event_on_page("Ruby Meetup @catalyst - Tanks! Guns!")
    expect(last_response).to have_event_on_page("The Foundation")
    expect(last_response).to have_event_on_page("WikiHouse/NZ weekly meet-up")
    expect(last_response).to have_event_on_page("Christchurch Python Meetup")
    expect(last_response).to have_event_on_page("Coffee & Jam")
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
almanack-0.0.1.alpha2 spec/features/calendar_feature_spec.rb
almanack-0.0.1.alpha1 spec/features/calendar_feature_spec.rb