diff --git a/spec/services/tag_search_service_spec.rb b/spec/services/tag_search_service_spec.rb new file mode 100644 index 000000000..de42e5407 --- /dev/null +++ b/spec/services/tag_search_service_spec.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +require 'rails_helper' + +RSpec.describe TagSearchService do + describe '#call' do + let!(:one) { Fabricate(:tag, name: 'one') } + + before { Fabricate(:tag, name: 'two') } + + it 'runs a search for tags' do + results = subject.call('#one', limit: 5) + + expect(results) + .to have_attributes( + size: 1, + first: eq(one) + ) + end + end +end