Skip to content

Commit

Permalink
feature specs and coveralls setup
Browse files Browse the repository at this point in the history
  • Loading branch information
ebenenglish committed Sep 10, 2015
1 parent e5ab857 commit c955718
Show file tree
Hide file tree
Showing 9 changed files with 121 additions and 14 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# CommonwealthVlrEngine

[![Coverage Status](https://coveralls.io/repos/boston-library/Commonwealth-public-interface/badge.svg?branch=master&service=github)](https://coveralls.io/github/boston-library/Commonwealth-public-interface?branch=master)

A plugin for Blacklight that provides base functionality for virtual local repositories (VLRs) pulling content from the main [Digital Commonwealth](http://digitalcommonwealth.org) repository managed by the Boston Public Library.

More documentation coming soon. This project is currently in high development and in a very beta state.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
$(document).ready(function() {

$('#appliedParams').find('a').attr('href', function(index,previousValue) {
return previousValue.replace(/search/,'institutions');
return previousValue.replace(/search\?/,'institutions?');
});

});
13 changes: 2 additions & 11 deletions app/assets/stylesheets/commonwealth-vlr-engine/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -39,17 +39,8 @@ body.blacklight-catalog-index {
background-color: #E2EDFE;
}

/* need to use background image here rather than CSS 'content'
/* which doesn't work in iOS */
.filterName {
background: asset-url('blacklight/separator.gif') no-repeat right center;
padding-right:14px;

&:after {
content: none;
padding-left: 2px;
}

.filterName:after {
padding-left: 2px;
}

}
Expand Down
4 changes: 4 additions & 0 deletions config/locales/commonwealth-vlr-engine.en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,10 @@ en:
nav: 'Institutions'
title: 'Institutions'

maps:
interactions:
institutions_search: 'View institutions from this location'

metadata_display:
date_range_connector: ''
fields:
Expand Down
27 changes: 27 additions & 0 deletions spec/features/collections/_az_links_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
require 'spec_helper'

include CommonwealthVlrEngine::CollectionsHelperBehavior

# set this helper to return true so AZ links are rendered
def should_render_col_az?
true
end

describe 'collections a-z links' do

it 'should show the a-z links' do
visit collections_path
within ('#collection_az_links') do
expect(page).to have_selector('.col_a-z_link')
end
end

it 'should show correct results after clicking a letter link' do
visit collections_path
within ('#collection_az_links') do
click_link('C')
end
expect(page).to have_selector('.document-title-heading', :text => 'Carte de Visite Collection')
end

end
28 changes: 28 additions & 0 deletions spec/features/image_viewer_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
require 'spec_helper'

describe 'openseadragon image viewer modal' do

it 'should display the OSd viewer modal when the image is clicked', :js => true do
visit solr_document_path(:id => 'bpl-dev:h702q6403')
click_link('img_viewer_link')
expect(page).to have_selector('.openseadragon-container')
end

end

describe 'multi image viewer' do

before(:each) do
visit solr_document_path(:id => 'bpl-dev:h702q6403')
click_link('carousel-nav_next')
end

it 'should display the next image when a prev-next link is clicked' do
expect(find('.img_show')['src']).to match /bpl-dev:h702q642n/
end

it 'should update the thumbnail in the #thumbnail_list' do
expect(all('#thumbnail_list li').last).to have_selector('.in_viewer')
end

end
38 changes: 38 additions & 0 deletions spec/features/institutions/map_view_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
require 'spec_helper'

describe 'Institutions#index map view', js: true do

before { visit institutions_path(:view => 'maps') }

it 'should show map marker' do
within ('#institutions-index-map') do
expect(page).to have_selector('.leaflet-marker-icon')
end
end

describe 'click marker cluster' do

before { find('div.leaflet-marker-icon').click }

it 'should show the search_form_institution content' do
within ('div.leaflet-popup-content') do
expect(page.text).to include('institution')
end
end

describe 'constraints links' do

before { find('div.leaflet-popup-content a').click }

it 'should have .constraints > a.remove that links to instititions#index' do
within ('#appliedParams') do
expect(page.html).to include('/institutions?')
end

end

end

end

end
18 changes: 18 additions & 0 deletions spec/fixtures/sample_solr_documents.yml
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,8 @@
- "Ancillary maps and insets: Principal motor routes in and out of Boston -- Do Not Turn -- Eaxtracts from \"City of Boston Street Traffic Regulations.\""
title_info_primary_tsi:
- Boston traffic map showing one way streets and parking spaces
title_info_primary_ssort:
- Boston traffic map showing one way streets and parking spaces
workflow_state_ssi:
- published
processing_state_ssi:
Expand Down Expand Up @@ -358,6 +360,8 @@
- Date supplied by cataloger.
title_info_primary_tsi:
- Beauregard
title_info_primary_ssort:
- Beauregard
workflow_state_ssi:
- published
processing_state_ssi:
Expand Down Expand Up @@ -560,6 +564,8 @@
- Gift of the family of William L. Garrison, August 31, 1899.
title_info_primary_tsi:
- George Thompson
title_info_primary_ssort:
- George Thompson
workflow_state_ssi:
- published
processing_state_ssi:
Expand Down Expand Up @@ -764,6 +770,8 @@
- New standard index map of Boston
title_info_primary_tsi:
- Guide map of Boston
title_info_primary_ssort:
- Guide map of Boston
title_info_alternative_label_ssm:
- Cover title
workflow_state_ssi:
Expand Down Expand Up @@ -845,6 +853,8 @@
- Collection
title_info_primary_tsi:
- Norman B. Leventhal Map Center Collection
title_info_primary_ssort:
- Norman B. Leventhal Map Center Collection
workflow_state_ssi:
- published
abstract_tsim:
Expand Down Expand Up @@ -896,6 +906,8 @@
- Collection
title_info_primary_tsi:
- Carte de Visite Collection
title_info_primary_ssort:
- Carte de Visite Collection
workflow_state_ssi:
- published
abstract_tsim:
Expand Down Expand Up @@ -947,6 +959,8 @@
- Collection
title_info_primary_tsi:
- Anti-Slavery Collection
title_info_primary_ssort:
- Anti-Slavery Collection
workflow_state_ssi:
- published
physical_location_ssim:
Expand Down Expand Up @@ -996,6 +1010,8 @@
- Collection
title_info_primary_tsi:
- Cased Photographs
title_info_primary_ssort:
- Cased Photographs
workflow_state_ssi:
- published
physical_location_ssim:
Expand Down Expand Up @@ -1038,6 +1054,8 @@
- Institution
title_info_primary_tsi:
- Boston Public Library
title_info_primary_ssort:
- Boston Public Library
workflow_state_ssi:
- published
abstract_tsim:
Expand Down
3 changes: 1 addition & 2 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,8 @@

Capybara.register_driver :poltergeist do |app|
options = {}

options[:js_errors] = false
options[:timeout] = 120 if RUBY_PLATFORM == "java"

Capybara::Poltergeist::Driver.new(app, options)
end

Expand Down

0 comments on commit c955718

Please sign in to comment.