Skip to content

Commit

Permalink
fix: add rescue instead of stub in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
deniskorobicyn committed May 31, 2018
1 parent fc58e7c commit e950f34
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 2 additions & 0 deletions lib/apress/api/api_controller/pagination_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 0 additions & 1 deletion spec/helpers/paginating_cache_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit e950f34

Please sign in to comment.