diff --git a/spec/features/export_geofile_spec.rb b/spec/features/export_geofile_spec.rb index a06b933..bdacefd 100644 --- a/spec/features/export_geofile_spec.rb +++ b/spec/features/export_geofile_spec.rb @@ -9,8 +9,8 @@ click_download_button end - it_behaves_like 'export geofile to local', 'berkeley-s7038h-shapefile.zip', 'Export Shapefile' - it_behaves_like 'export geofile to local', 'berkeley-s7038h-kmz.kmz', 'Export KMZ' - it_behaves_like 'export geofile to local', 'berkeley-s7038h-geojson.json', 'Export GeoJSON' + it_behaves_like 'export geofile to local', "#{CommonHelpers::PUBLIC_RECORD_ID}-shapefile.zip", 'Export Shapefile' + it_behaves_like 'export geofile to local', "#{CommonHelpers::PUBLIC_RECORD_ID}-kmz.kmz", 'Export KMZ' + it_behaves_like 'export geofile to local', "#{CommonHelpers::PUBLIC_RECORD_ID}-geojson.json", 'Export GeoJSON' end diff --git a/spec/support/common_helpers.rb b/spec/support/common_helpers.rb index 02f037e..244a99d 100644 --- a/spec/support/common_helpers.rb +++ b/spec/support/common_helpers.rb @@ -1,13 +1,15 @@ module CommonHelpers EXPORT_TMP_PATH = '/opt/app/tmp/cache/downloads'.freeze DOWNLOAD_TMP_PATH = '/opt/app/tmp/selenium_downloads'.freeze + PUBLIC_RECORD_ID = 'berkeley-s7038h'.freeze + RESTRICTED_RECORD_ID = 'berkeley-s7b12n'.freeze def view_public_record - visit 'catalog/berkeley-s7038h' + visit "catalog/#{PUBLIC_RECORD_ID}" end def view_restricted_record - visit '/catalog/berkeley-s7b12n' + visit "/catalog/#{RESTRICTED_RECORD_ID}" end def click_download_button diff --git a/spec/system/public_result_spec.rb b/spec/system/public_result_spec.rb index a1bd2eb..9f4c49b 100644 --- a/spec/system/public_result_spec.rb +++ b/spec/system/public_result_spec.rb @@ -13,7 +13,7 @@ context 'metadata link' do it 'displays the metadata link' do - expect(page).to have_link('Metadata', href: '/catalog/berkeley-s7038h/metadata') + expect(page).to have_link('Metadata', href: "/catalog/#{CommonHelpers::PUBLIC_RECORD_ID}/metadata") end it 'clicking the metadata link, triggers the modal', js: true do