<commit_before>require 'spec_helper'
require 'core/interactors/action_plan_reader'
require 'core/entities/action_plan'

describe ActionPlansController do
  let(:action_plan) { double(Core::ActionPlan, id: 'test') }
  let(:action_plan_reader) { double(Core::ActionPlanReader, call: action_plan) }

  before { allow_any_instance_of(Core::ActionPlanReader).to receive(:call) { action_plan } }

  describe 'GET show' do
    it 'is successful' do
      get :show, locale: I18n.locale, id: 'foo'

      expect(response).to be_ok
    end

    it 'instantiates an action plan reader' do
      expect(Core::ActionPlanReader).to receive(:new).with(action_plan.id) { action_plan_reader }

      get :show, locale: I18n.locale, id: action_plan.id
    end

    it 'it assigns @action_plan to the result of action_plan reader' do
      get :show, locale: I18n.locale, id: action_plan.id

      expect(assigns(:action_plan)).to eq(action_plan)
    end
  end
end<commit_msg>Fix typo<commit_after>require 'spec_helper'
require 'core/interactors/action_plan_reader'
require 'core/entities/action_plan'

describe ActionPlansController do
  let(:action_plan) { double(Core::ActionPlan, id: 'test') }
  let(:action_plan_reader) { double(Core::ActionPlanReader, call: action_plan) }

  before { allow_any_instance_of(Core::ActionPlanReader).to receive(:call) { action_plan } }

  describe 'GET show' do
    it 'is successful' do
      get :show, locale: I18n.locale, id: 'foo'

      expect(response).to be_ok
    end

    it 'instantiates an action plan reader' do
      expect(Core::ActionPlanReader).to receive(:new).with(action_plan.id) { action_plan_reader }

      get :show, locale: I18n.locale, id: action_plan.id
    end

    it 'assigns @action_plan to the result of action_plan reader' do
      get :show, locale: I18n.locale, id: action_plan.id

      expect(assigns(:action_plan)).to eq(action_plan)
    end
  end
end
{'fraction_non_alphanumeric': 0.11006289308176101, 'fraction_numerical': 0.006289308176100629, 'mean_word_length': 4.3175487465181055, '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': '3131298', 'n_tokens_mistral': 640, 'n_tokens_neox': 614, 'n_words': 153}