diff --git a/spec/services/process_hashtags_service_spec.rb b/spec/services/process_hashtags_service_spec.rb new file mode 100644 index 0000000000..a0d5ef3464 --- /dev/null +++ b/spec/services/process_hashtags_service_spec.rb @@ -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