<commit_before>require 'rails_helper'

RSpec.describe ProposalsController, type: :controller do
  render_views
  
  before :each do
    @proposer = create :user, contributor: true, notify_new: true
    @proposal = create :proposal, proposer: @proposer
  end
  
  it "should show index page" do
    get :index
    expect(response).to be_ok
    expect(response.body).to include "https://openpolitics.org.uk"
  end

  it "should show individual proposal page" do
    # Stub out the calls to github data
    allow_any_instance_of(Proposal).to receive(:commits).and_return([])
    allow_any_instance_of(Proposal).to receive(:description).and_return("test")
    allow_any_instance_of(Proposal).to receive(:submitted_at).and_return(1.hour.ago)<commit_msg>update test to match new method name<commit_after>require 'rails_helper'

RSpec.describe ProposalsController, type: :controller do
  render_views
  
  before :each do
    @proposer = create :user, contributor: true, notify_new: true
    @proposal = create :proposal, proposer: @proposer
  end
  
  it "should show index page" do
    get :index
    expect(response).to be_ok
    expect(response.body).to include "https://openpolitics.org.uk"
  end

  it "should show individual proposal page" do
    # Stub out the calls to github data
    allow_any_instance_of(Proposal).to receive(:github_commits).and_return([])
    allow_any_instance_of(Proposal).to receive(:description).and_return("test")
    allow_any_instance_of(Proposal).to receive(:submitted_at).and_return(1.hour.ago)
{'fraction_non_alphanumeric': 0.09960681520314547, 'fraction_numerical': 0.001310615989515072, 'mean_word_length': 4.634686346863469, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, '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': '124979', 'n_tokens_mistral': 485, 'n_tokens_neox': 475, 'n_words': 121}