about summary refs log tree commit diff
path: root/spec/services/resolve_url_service_spec.rb
blob: aa4204637187d980ef2fc705fc4b442d63ff1375 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# frozen_string_literal: true

require 'rails_helper'

describe ResolveURLService, type: :service do
  subject { described_class.new }

  describe '#call' do
    it 'returns nil when there is no resource url' do
      url     = 'http://example.com/missing-resource'
      service = double

      allow(FetchResourceService).to receive(:new).and_return service
      allow(service).to receive(:call).with(url).and_return(nil)

      expect(subject.call(url)).to be_nil
    end
  end
end