闭社主体 forked from https://github.com/tootsuite/mastodon
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

19 lines
486 B

  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