Sha256: 5508f4fedc4e18d0290d4a4dea658bc47a26073cddddcd713280ba9bd7248f1a

Contents?: true

Size: 843 Bytes

Versions: 1

Compression:

Stored size: 843 Bytes

Contents

require 'rails_helper'

feature 'import events from a feed' do
  background do
    Timecop.travel('2010-01-01')
    stub_request(:get, 'http://even.ts/feed').to_return(body: read_sample('ical_multiple_calendars.ics'))
  end

  after do
    Timecop.return
  end

  scenario 'A user imports an events from a feed' do
    visit '/'
    click_on 'Import event(s)'

    fill_in 'URL', with: 'http://even.ts/feed'
    click_on 'Import'

    expect(find(".flash")).to have_content %(
      Imported 3 entries:

      Coffee with Jason
      Coffee with Mike
      Coffee with Kim
    )

    expect(page).to have_content 'Viewing 3 future events'

    expect(find(".event_table")).to have_content %(
      Thursday Apr 8

      Coffee with Jason
      7–8am

      Coffee with Mike
      7–8am

      Coffee with Kim
      7–8am
    )
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
calagator-0.0.1.pre1 spec/features/import_events_from_feed_spec.rb