@@ -36,54 +36,4 @@ class RecordControllerTest < ActionDispatch::IntegrationTest
3636 assert_select 'main' , /(.*)#{ message } (.*)/
3737 end
3838 end
39-
40- class RecordControllerGeoTest < RecordControllerTest
41- test 'no access button displays if GDT feature is disabled' do
42- gis_record_id = 'gismit:CAMBRIDGEMEMPOLES09'
43- VCR . use_cassette ( 'gis record mit free' ,
44- allow_playback_repeats : true ,
45- match_requests_on : %i[ method uri body ] ) do
46- get "/record/#{ gis_record_id } "
47- assert_select 'a.access-button' , count : 0
48- end
49- end
50-
51- test 'access button displays for freely accessible data' do
52- ClimateControl . modify FEATURE_GEODATA : 'true' do
53- gis_record_id = 'gismit:CAMBRIDGEMEMPOLES09'
54- VCR . use_cassette ( 'gis record mit free' ,
55- allow_playback_repeats : true ,
56- match_requests_on : %i[ method uri body ] ) do
57- get "/record/#{ gis_record_id } "
58- assert_select 'a.access-button' , text : 'Download geodata files' ,
59- href : 'https://cdn.dev1.mitlibrary.net/geo/public/CAMBRIDGEMEMPOLES09.zip'
60- end
61- end
62- end
63-
64- test 'access button displays for data requiring MIT auth' do
65- ClimateControl . modify FEATURE_GEODATA : 'true' do
66- gis_record_id = 'gismit:us_ma_boston_g47parcels_2018'
67- VCR . use_cassette ( 'gis record mit auth' ,
68- allow_playback_repeats : true ,
69- match_requests_on : %i[ method uri body ] ) do
70- get "/record/#{ gis_record_id } "
71- assert_select 'a.access-button' , text : 'Download geodata files MIT authentication' ,
72- href : 'https://cdn.dev1.mitlibrary.net/geo/restricted/us_ma_boston_g47parcels_2018.zip'
73- end
74- end
75- end
76-
77- test 'access button displays for non-MIT GIS records' do
78- ClimateControl . modify FEATURE_GEODATA : 'true' do
79- gis_record_id = 'gisogm:edu.stanford.purl:be6ef8cd8ac5'
80- VCR . use_cassette ( 'gis record elsewhere' ,
81- allow_playback_repeats : true ,
82- match_requests_on : %i[ method uri body ] ) do
83- get "/record/#{ gis_record_id } "
84- assert_select 'a.access-button' , text : 'View Stanford record' , href : 'https://purl.stanford.edu/kv971cf1984'
85- end
86- end
87- end
88- end
8939end
0 commit comments