Sha256: 1e6b534bbb673cc42255e7f41a35b3d92a68b2fe42461c03cdaec1f114f098fa

Contents?: true

Size: 1.56 KB

Versions: 8

Compression:

Stored size: 1.56 KB

Contents

# frozen_string_literal: true
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 'navbar' do
    expect(page).to have_css '#bookmarks_nav'
    expect(page).to have_css 'a', text: 'History'
  end
  scenario 'search bar' do
    expect(page).not_to 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: 36
    expect(page).to have_css 'a.more_facets_link', count: 4
    click_link 'Elevation'
    expect(page).to have_css '.filter-name', text: 'Subject'
    expect(page).to have_css '.filter-value', text: 'Elevation'
  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
    within '#map' do
      find('.search-control a').click
      expect(page.current_url).to match(/bbox=/)
    end
    expect(page).to have_css '#documents'
  end
  scenario 'can search by placename' do
    click_link 'Minnesota, United States'
    results = page.all(:css, 'article.document')
    expect(results.count).to equal(3)
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
geoblacklight-3.5.0 spec/features/home_page_spec.rb
geoblacklight-3.4.0 spec/features/home_page_spec.rb
geoblacklight-3.3.1 spec/features/home_page_spec.rb
geoblacklight-3.3.0 spec/features/home_page_spec.rb
geoblacklight-3.2.0 spec/features/home_page_spec.rb
geoblacklight-3.1.0 spec/features/home_page_spec.rb
geoblacklight-3.0.1 spec/features/home_page_spec.rb
geoblacklight-3.0.0 spec/features/home_page_spec.rb