diff --git a/lib/apress/api/api_controller/pagination_helper.rb b/lib/apress/api/api_controller/pagination_helper.rb index 6d0c5a6..09f3fe1 100644 --- a/lib/apress/api/api_controller/pagination_helper.rb +++ b/lib/apress/api/api_controller/pagination_helper.rb @@ -27,6 +27,8 @@ def self.header_link_values(url, page_numbers) %(<#{url}>; rel="#{rel}") end + rescue Addressable::URI::InvalidURIError + [] end def self.page_numbers(collection) diff --git a/spec/helpers/paginating_cache_spec.rb b/spec/helpers/paginating_cache_spec.rb index 982afa8..b1feb3a 100644 --- a/spec/helpers/paginating_cache_spec.rb +++ b/spec/helpers/paginating_cache_spec.rb @@ -19,7 +19,6 @@ def jbuild(source_key, collection) resolver = ActionView::FixtureResolver.new(partials) lookup_context.view_paths = [resolver] - allow(controller).to receive_message_chain(:request, :url).and_return('https://example.com/') assign(:collection, collection) MultiJson.load(render(template: source_key)) end