mirror of
https://github.com/mastodon/mastodon.git
synced 2024-11-22 14:15:22 +00:00
Add basic coverage for TagSearchService
class (#29319)
This commit is contained in:
parent
96013cd576
commit
19f0590795
21
spec/services/tag_search_service_spec.rb
Normal file
21
spec/services/tag_search_service_spec.rb
Normal 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
|
Loading…
Reference in a new issue