Sha256: 6bdf6ae0aecab003ca4f6ceed1531a476efa4a999d08a08de7988f0708f0e356

Contents?: true

Size: 851 Bytes

Versions: 1

Compression:

Stored size: 851 Bytes

Contents

require 'rails_helper'

feature 'import events from a feed', js: true 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 events'

    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-1.1.0 spec/features/import_events_from_feed_spec.rb