diff --git a/spec/features/patient_sorting_filtering_spec.rb b/spec/features/patient_sorting_filtering_spec.rb index cbf1c567f..cc33fba8b 100644 --- a/spec/features/patient_sorting_filtering_spec.rb +++ b/spec/features/patient_sorting_filtering_spec.rb @@ -34,7 +34,7 @@ then_i_see_patients_with_year_group_10 end - scenario "Users can sort and filter patients with JS", type: :system do + scenario "Users can sort and filter patients with JS", :js do given_that_i_am_signed_in when_i_visit_the_consents_page then_i_see_patients_ordered_by_name_asc diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 9690cd68f..1840ac3e3 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -121,8 +121,10 @@ process_timeout: 30 ) end -Capybara.javascript_driver = :cuprite_custom + Capybara.asset_host = "http://localhost:4000" +Capybara.javascript_driver = :cuprite_custom +Capybara.server = :puma, { Silent: true } ActiveJob::Base.queue_adapter = :test @@ -202,12 +204,8 @@ # arbitrary gems may also be filtered via: # config.filter_gems_from_backtrace("gem name") - config.before(:each, type: :system) do - WebMock.disable! - driven_by(:cuprite_custom) - end - - config.after(:each, type: :system) { WebMock.enable! } + config.before(:each, :js) { WebMock.allow_net_connect! } + config.after(:each, :js) { WebMock.disable_net_connect! } config.before do ActionMailer::Base.deliveries.clear @@ -218,7 +216,6 @@ config.include ActiveSupport::Testing::TimeHelpers config.include Capybara::RSpecMatchers, type: :component config.include Devise::Test::IntegrationHelpers, type: :feature - config.include Devise::Test::IntegrationHelpers, type: :system config.include CIS2AuthHelper, type: :feature config.include PDSHelper, type: :feature config.include EmailExpectations, type: :feature