mirror of
https://github.com/glitch-soc/mastodon.git
synced 2024-11-27 10:30:15 -05:00
Add basic coverage for ProcessHashtagsService
class (#29320)
This commit is contained in:
parent
1f648fdf1a
commit
5f19e7e799
16
spec/services/process_hashtags_service_spec.rb
Normal file
16
spec/services/process_hashtags_service_spec.rb
Normal file
@ -0,0 +1,16 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require 'rails_helper'
|
||||
|
||||
RSpec.describe ProcessHashtagsService do
|
||||
describe '#call' do
|
||||
let(:status) { Fabricate(:status, visibility: :public, text: 'With tags #one #two') }
|
||||
|
||||
it 'applies the tags from the status text' do
|
||||
expect { subject.call(status) }
|
||||
.to change(Tag, :count).by(2)
|
||||
expect(status.reload.tags.map(&:name))
|
||||
.to contain_exactly('one', 'two')
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Reference in New Issue
Block a user