From 19f0590795500c2a93baa317b79b53efaca2ec88 Mon Sep 17 00:00:00 2001 From: Matt Jankowski Date: Wed, 13 Mar 2024 04:33:03 -0400 Subject: [PATCH] Add basic coverage for `TagSearchService` class (#29319) --- spec/services/tag_search_service_spec.rb | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 spec/services/tag_search_service_spec.rb diff --git a/spec/services/tag_search_service_spec.rb b/spec/services/tag_search_service_spec.rb new file mode 100644 index 0000000000..de42e54071 --- /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