<commit_before>require 'rails_helper'

describe PatientsController do
  describe '#index' do
    let(:patients) { [double(:patient)] }

    before do
      allow(Patient).to receive(:all) { patients }
      get :index
    end

    it 'assings @patients' do
      expect(assigns(:patients)).to eq(patients)
    end

    it 'renders the :index template' do
      expect(response).to render_template(:index)
    end

    it 'responds with ok' do
      expect(response).to be_ok
    end
  end

  describe '#new' do
    let(:patient) { double(:patient) }

    before do
      allow(Patient).to receive(:new) { patient }
      get :new
    end

    it 'assings @patient' do
      expect(assigns(:patient)).to eq(patient)
    end

    it 'renders the :new template' do
      expect(response).to render_template(:new)
    end

    it 'responds with ok' do
      expect(response).to be_ok
    end
  end
end<commit_msg>Use one-liner syntax expectations when possible<commit_after>require 'rails_helper'

describe PatientsController do
  describe '#index' do
    let(:patients) { [double(:patient)] }

    before do
      allow(Patient).to receive(:all) { patients }
      get :index
    end

    it 'assings @patients' do
      expect(assigns(:patients)).to eq(patients)
    end

    it { is_expected.to render_template :index }

    it { is_expected.to respond_with :ok }
  end

  describe '#new' do
    let(:patient) { double(:patient) }

    before do
      allow(Patient).to receive(:new) { patient }
      get :new
    end

    it 'assings @patient' do
      expect(assigns(:patient)).to eq(patient)
    end

    it { is_expected.to render_template :new }

    it { is_expected.to respond_with :ok }
  end
end
{'fraction_non_alphanumeric': 0.1073943661971831, 'fraction_numerical': 0.0, 'mean_word_length': 2.7804878048780486, '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': '815152', 'n_tokens_mistral': 553, 'n_tokens_neox': 515, 'n_words': 150}