diff --git a/Gemfile.lock b/Gemfile.lock index 563692f8e0..43123dfc51 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -772,7 +772,7 @@ GEM webfinger (1.2.0) activesupport httpclient (>= 2.4) - webmock (3.18.1) + webmock (3.19.1) addressable (>= 2.8.0) crack (>= 0.3.2) hashdiff (>= 0.4.0, < 2.0.0) diff --git a/spec/system/admin/invoice_print_spec.rb b/spec/system/admin/invoice_print_spec.rb index 790db07849..45a6823706 100644 --- a/spec/system/admin/invoice_print_spec.rb +++ b/spec/system/admin/invoice_print_spec.rb @@ -29,7 +29,12 @@ describe ' before do Capybara.current_driver = :rack_test - stub_request(:get, ->(uri) { uri.to_s.include? "/css/mail" }) + + # 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 diff --git a/spec/views/spree/admin/orders/invoice.html.haml_spec.rb b/spec/views/spree/admin/orders/invoice.html.haml_spec.rb index e6cccbdced..f0aebd480e 100644 --- a/spec/views/spree/admin/orders/invoice.html.haml_spec.rb +++ b/spec/views/spree/admin/orders/invoice.html.haml_spec.rb @@ -27,7 +27,11 @@ describe "spree/admin/orders/invoice.html.haml" do display_checkout_total_less_tax: '8', outstanding_balance_label: 'Outstanding Balance' - stub_request(:get, ->(uri) { uri.to_s.include? "/css/mail" }) + # 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