@@ -38,51 +38,51 @@ class RecordControllerTest < ActionDispatch::IntegrationTest
3838 end
3939
4040 class RecordControllerGeoTest < RecordControllerTest
41- def setup
42- @test_strategy = Flipflop ::FeatureSet . current . test!
43- @test_strategy . switch! ( :gdt , true )
44- end
45-
4641 test 'no access button displays if GDT feature is disabled' do
47- @test_strategy . switch! ( :gdt , false )
4842 gis_record_id = 'gismit:CAMBRIDGEMEMPOLES09'
4943 VCR . use_cassette ( 'gis record mit free' ,
50- allow_playback_repeats : true ,
51- match_requests_on : %i[ method uri body ] ) do
44+ allow_playback_repeats : true ,
45+ match_requests_on : %i[ method uri body ] ) do
5246 get "/record/#{ gis_record_id } "
5347 assert_select 'a.access-button' , count : 0
5448 end
5549 end
5650
5751 test 'access button displays for freely accessible data' do
58- gis_record_id = 'gismit:CAMBRIDGEMEMPOLES09'
59- VCR . use_cassette ( 'gis record mit free' ,
60- allow_playback_repeats : true ,
61- match_requests_on : %i[ method uri body ] ) do
62- get "/record/#{ gis_record_id } "
63- assert_select 'a.access-button' , text : 'Download geodata files' ,
64- href : 'https://cdn.dev1.mitlibrary.net/geo/public/CAMBRIDGEMEMPOLES09.zip'
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
6561 end
6662 end
6763
6864 test 'access button displays for data requiring MIT auth' do
69- gis_record_id = 'gismit:us_ma_boston_g47parcels_2018'
70- VCR . use_cassette ( 'gis record mit auth' ,
71- allow_playback_repeats : true ,
72- match_requests_on : %i[ method uri body ] ) do
73- get "/record/#{ gis_record_id } "
74- assert_select 'a.access-button' , text : 'Download geodata files MIT authentication' ,
75- href : 'https://cdn.dev1.mitlibrary.net/geo/restricted/us_ma_boston_g47parcels_2018.zip'
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
7674 end
7775 end
7876
7977 test 'access button displays for non-MIT GIS records' do
80- gis_record_id = 'gisogm:edu.stanford.purl:be6ef8cd8ac5'
81- VCR . use_cassette ( 'gis record elsewhere' ,
82- allow_playback_repeats : true ,
83- match_requests_on : %i[ method uri body ] ) do
84- get "/record/#{ gis_record_id } "
85- assert_select 'a.access-button' , text : 'View Stanford record' , href : 'https://purl.stanford.edu/kv971cf1984'
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
8686 end
8787 end
8888 end
0 commit comments