Return a duplicate empty string for css pack request

This commit is contained in:
Gaetan Craig-Riou
2024-01-10 16:46:13 +11:00
parent 9ea6fc00cb
commit 557e6e6a37
2 changed files with 11 additions and 10 deletions

View File

@@ -29,12 +29,12 @@ describe '
before do
Capybara.current_driver = :rack_test
# Ignore request for CSS pack like: 'http://www.example.com/packs-test/css/mail-1ab2dc7f.css'
VCR.configure do |config|
config.ignore_request do |request|
request.uri.to_s.include?('packs-test/css/mail')
end
end
# return a duplicate empaty string for CSS pack request like:
# 'http://test.host/packs-test/css/mail-1ab2dc7f.css'
# This is because Wicked PDF will try to force an encoding on the returned string, which will
# break with a frozen string
stub_request(:get, ->(uri) { uri.to_s.include? "/css/mail" }).to_return(body: "".dup)
end
after do

View File

@@ -27,10 +27,11 @@ describe "spree/admin/orders/invoice.html.haml" do
display_checkout_total_less_tax: '8',
outstanding_balance_label: 'Outstanding Balance'
# Ignore requests for CSS pack like: 'http://test.host/packs-test/css/mail-1ab2dc7f.css'
VCR.configure do |config|
config.ignore_hosts('test.host')
end
# return a duplicate empaty string for CSS pack request like:
# 'http://test.host/packs-test/css/mail-1ab2dc7f.css'
# This is because Wicked PDF will try to force an encoding on the returned string, which will
# break with a frozen string
stub_request(:get, ->(uri) { uri.to_s.include? "/css/mail" }).to_return(body: "".dup)
end
it "displays the customer code" do