Sha256: 0b7f95c45dba9adc0a31327df246b69af1e68d8b57fce0bf57dbc7b7b4431d9f

Contents?: true

Size: 1.2 KB

Versions: 1

Compression:

Stored size: 1.2 KB

Contents

require 'spec_helper'

feature 'Home page', js: true do # use js: true for tests which require js, but it slows things down
  before do
    visit root_path
  end
  scenario 'search bar' do
    expect(page).to_not have_css '#search-navbar'
    within '.jumbotron' do
      expect(page).to have_css 'h2', text: 'Explore and discover...'
      expect(page).to have_css 'h3', text: 'Find the maps and data you need'
      expect(page).to have_css 'form.search-query-form'
    end
  end
  scenario 'find by category' do
    expect(page).to have_css '.category-block', count: 4
    expect(page).to have_css '.home-facet-link', count: 28
    click_link 'Census'
    expect(page).to have_css '.filterName', text: 'Subject'
    expect(page).to have_css '.filterValue', text: 'Census'
  end
  scenario 'map should be visible' do
    within '#main-container' do
      expect(page).to have_css('#map')
      expect(page).to have_css('img.leaflet-tile', minimum: 3)
    end
  end
  scenario 'clicking map search should create a spatial search' do
    find('#map').double_click
    within '#map' do
      find('a.search-control').click
      expect(page.current_url).to match /bbox=/
    end
    expect(page).to have_css '#documents'
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
geoblacklight-0.1.0 spec/features/home_page_spec.rb