Skip to content

Commit

Permalink
Make sure that the download button is displayed
Browse files Browse the repository at this point in the history
This modifies the solr document fixture so that a download
button is displayed on the show page. There is a feature
test that ensures that the correct URL and the button
are on the page.

Closes #19
  • Loading branch information
little9 committed Apr 10, 2018
1 parent ed51a88 commit e7b8eb9
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
15 changes: 15 additions & 0 deletions spec/features/download_zip_button_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# frozen_string_literal: true
require 'rails_helper'

RSpec.describe 'downloading the shapefile as a zip', type: :feature do
let(:download_path) { '/download/gford-20140000-010015_belvegr?type=shapefile' }
let(:page_markup) { page.html.to_s }
before do
Rake::Task['geoblacklight:solr:seed'].invoke
end
scenario 'viewing the download button on the show page' do
visit solr_document_path 'gford-20140000-010015_belvegr'
expect(page).to have_content('Download Shapefile')
expect(page_markup.include?(download_path)).to eq(true)
end
end
3 changes: 2 additions & 1 deletion spec/fixtures/solr_documents/maya_forest.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"dc_subject_sm":"Belize",
"dc_creator_sm":"UCSB",
"dct_provenance_s": "UCSB",
"layer_geom_type_s": "Polygon"
"layer_geom_type_s": "Mixed",
"dc_format_s":"Shapefile"
}
]

0 comments on commit e7b8eb9

Please sign in to comment.