Sha256: 63ae48cf6f2293d67bf965b9884cd8cb796015f7b36533dba6cd3a1798364b13

Contents?: true

Size: 834 Bytes

Versions: 3

Compression:

Stored size: 834 Bytes

Contents

require 'rails_helper'

feature 'search for events' do
  background do
    create :event, title: 'Ruby Future', start_time: today + 1.day
    create :event, title: 'Python Past', start_time: today - 1.day
    create :event, title: 'Ruby Part 2 Past', start_time: today - 2.day
    create :event, title: 'Ruby Part 1 Past', start_time: today - 3.day
  end

  scenario 'User searches for an event by name' do
    visit '/'

    find_field('Search Events').native.send_keys "Ruby\n"

    within('#current') do
      expect(page).to have_content 'Viewing 1 current event'
      expect(page).to have_content 'Ruby Future'
    end

    within('#past') do
      expect(page).to have_content 'Viewing 2 past events'
      expect(page).to have_content 'Ruby Part 2 Past'
      expect(page).to have_content 'Ruby Part 1 Past'
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
calagator-1.0.0.rc2 spec/features/search_event_spec.rb
calagator-1.0.0.rc1 spec/features/search_event_spec.rb
calagator-0.0.1.pre1 spec/features/search_event_spec.rb