Skip to content

Commit

Permalink
adds test for the layer download url
Browse files Browse the repository at this point in the history
  • Loading branch information
mejackreed committed Aug 4, 2016
1 parent 4a77a38 commit 99ce72b
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions spec/features/download_layer_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@
expect(shapefile_download).to receive(:get).and_return('mit-us-ma-e25zcta5dct-2000-shapefile.zip')
visit solr_document_path('mit-us-ma-e25zcta5dct-2000')
find('a', text: 'Download Shapefile').click
expect(page).to have_css('a', text: 'Your file mit-us-ma-e25zcta5dct-2000-shapefile.zip is ready for download')
expect(page).to have_css(
'a[href="/download/file/mit-us-ma-e25zcta5dct-2000-shapefile.zip"]',
text: 'Your file mit-us-ma-e25zcta5dct-2000-shapefile.zip is ready for download'
)
end
scenario 'failed download should return message with link to layer', js: true do
expect(shapefile_download).to receive(:get).and_raise(Geoblacklight::Exceptions::ExternalDownloadFailed.new(message: 'Failed', url: 'http://www.example.com/failed'))
Expand All @@ -29,7 +32,10 @@
visit solr_document_path('mit-us-ma-e25zcta5dct-2000')
find('button.download-dropdown-toggle').click
find('a', text: 'Download KMZ').click
expect(page).to have_css('a', text: 'Your file mit-us-ma-e25zcta5dct-2000-kmz.kmz is ready for download')
expect(page).to have_css(
'a[href="/download/file/mit-us-ma-e25zcta5dct-2000-kmz.kmz"]',
text: 'Your file mit-us-ma-e25zcta5dct-2000-kmz.kmz is ready for download'
)
end
scenario 'jpg download option should be present under toggle' do
visit solr_document_path('princeton-02870w62c')
Expand Down

0 comments on commit 99ce72b

Please sign in to comment.