<commit_before># frozen_string_literal: true

require "rails_helper"
require "errors"
require "use_case/question/create_followers"

describe UseCase::Question::CreateFollowers do
  subject do
    UseCase::Question::CreateFollowers.call(
      source_user_id:    source_user.id,
      content:           content,
      author_identifier: author_identifier
    )
  end

  context "user is logged in" do
    let(:source_user) { create(:user) }
    let(:content) { "content" }
    let(:author_identifier) { nil }

    it "creates question" do
      expect(subject[:question]).to be_persisted
    end

    it "enqueues a QuestionWorker job" do
      expect(QuestionWorker).to have_enqueued_sidekiq_job(source_user.id, subject[:question].id)
    end
  end
end<commit_msg>Fix tests for `UseCase::Question::CreateFollowers`<commit_after># frozen_string_literal: true

require "rails_helper"
require "errors"
require "use_case/question/create_followers"

describe UseCase::Question::CreateFollowers do
  subject do
    UseCase::Question::CreateFollowers.call(
      source_user_id:    source_user.id,
      content:           content,
      author_identifier: author_identifier
    )
  end

  context "user is logged in" do
    let(:source_user) { create(:user) }
    let(:content) { "content" }
    let(:author_identifier) { nil }

    it "creates question" do
      expect(subject[:resource]).to be_persisted
    end

    it "enqueues a QuestionWorker job" do
      expect(QuestionWorker).to have_enqueued_sidekiq_job(source_user.id, subject[:resource].id)
    end
  end
end
{'fraction_non_alphanumeric': 0.09700063816209317, 'fraction_numerical': 0.0, 'mean_word_length': 3.869565217391304, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2007915', 'n_tokens_mistral': 489, 'n_tokens_neox': 478, 'n_words': 108}