resolve_url_service_spec.rb 486 B

12345678910111213141516171819
  1. # frozen_string_literal: true
  2. require 'rails_helper'
  3. describe ResolveURLService, type: :service do
  4. subject { described_class.new }
  5. describe '#call' do
  6. it 'returns nil when there is no resource url' do
  7. url = 'http://example.com/missing-resource'
  8. service = double
  9. allow(FetchResourceService).to receive(:new).and_return service
  10. allow(service).to receive(:call).with(url).and_return(nil)
  11. expect(subject.call(url)).to be_nil
  12. end
  13. end
  14. end