From aa46348c03579147114e894954ee2e29a62c8e02 Mon Sep 17 00:00:00 2001 From: Matt Jankowski Date: Wed, 2 Oct 2024 09:56:26 -0400 Subject: [PATCH] Enable hostname config for all system specs (#32109) --- spec/rails_helper.rb | 5 +++++ spec/system/invites_spec.rb | 5 +---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/spec/rails_helper.rb b/spec/rails_helper.rb index ee03b49bc..84cee0974 100644 --- a/spec/rails_helper.rb +++ b/spec/rails_helper.rb @@ -161,6 +161,11 @@ RSpec.configure do |config| host! Rails.configuration.x.local_domain end + config.before :each, type: :system do + # Align with capybara config so that rails helpers called from rspec use matching host + host! 'localhost:3000' + end + config.after do Rails.cache.clear redis.del(redis.keys) diff --git a/spec/system/invites_spec.rb b/spec/system/invites_spec.rb index c57de871c..fc60ce591 100644 --- a/spec/system/invites_spec.rb +++ b/spec/system/invites_spec.rb @@ -7,10 +7,7 @@ RSpec.describe 'Invites' do let(:user) { Fabricate :user } - before do - host! 'localhost:3000' # TODO: Move into before for all system specs? - sign_in user - end + before { sign_in user } describe 'Viewing invites' do it 'Lists existing user invites' do