Commit 472f42bd authored by Heinrich Lee Yu's avatar Heinrich Lee Yu

Fix asset host setting leaking to other specs

Resets the asset host after the spec so we don't leak changes to
succeeding tests
parent 2bdafdb3
...@@ -7,6 +7,15 @@ RSpec.describe 'Rails asset host initializer' do ...@@ -7,6 +7,15 @@ RSpec.describe 'Rails asset host initializer' do
load Rails.root.join('config/initializers/rails_asset_host.rb') load Rails.root.join('config/initializers/rails_asset_host.rb')
end end
around do |example|
old_asset_host = Rails.application.config.action_controller.asset_host
example.run
Rails.application.config.action_controller.asset_host = old_asset_host
ActionController::Base.asset_host = old_asset_host
end
subject { Rails.application.config.action_controller.asset_host } subject { Rails.application.config.action_controller.asset_host }
it 'uses no asset host by default' do it 'uses no asset host by default' do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment