Sha256: 4857f03c4d6e888edeac8a805390a8c2ddaa238403a64639bb32de051b0dfcc3

Contents?: true

Size: 1.44 KB

Versions: 7

Compression:

Stored size: 1.44 KB

Contents

require 'spec_helper'

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

  it "displays all upcoming events" do
    now = Time.now

    Almanack.config.add_events [
      { title: "Hogswatch", start_time: now },
      { title: "Soul Cake Tuesday", start_time: now + 10 * 24 * 60 * 60 },
      { title: "Eve of Small Gods", start_time: now + 30 * 24 * 60 * 60 },
    ]

    Timecop.freeze(now) do
      get "/"
    end

    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

  it "allows being embedded in an iframe" do
    get "/"
    expect(last_response.headers).to_not have_key("X-Frame-Options")
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
almanack-1.1.0 spec/features/calendar_feature_spec.rb
almanack-1.1.0.beta6 spec/features/calendar_feature_spec.rb
almanack-1.1.0.beta5 spec/features/calendar_feature_spec.rb
almanack-1.1.0.beta4 spec/features/calendar_feature_spec.rb
almanack-1.1.0.beta3 spec/features/calendar_feature_spec.rb
almanack-1.1.0.beta2 spec/features/calendar_feature_spec.rb
almanack-1.1.0.beta1 spec/features/calendar_feature_spec.rb