Add basic coverage for `TagSearchService` class (#29319)

pull/29567/head
Matt Jankowski 2024-03-13 04:33:03 -04:00 committed by GitHub
parent 96013cd576
commit 19f0590795
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 21 additions and 0 deletions

View File

@ -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