Skip to content

Commit

Permalink
using record ids
Browse files Browse the repository at this point in the history
  • Loading branch information
yzhoubk committed Jan 18, 2025
1 parent e54283f commit 4008dec
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
6 changes: 3 additions & 3 deletions spec/features/export_geofile_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
6 changes: 4 additions & 2 deletions spec/support/common_helpers.rb
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion spec/system/public_result_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 4008dec

Please sign in to comment.