<commit_before>require 'rails_helper'

  describe QuestionsController do

    it "#index" do
      get :index
      expect(assigns(:questions)).to eq Question.all
    end

    it "#new" do
      get :new
    end

    context "#create" do

      it "creates a question with valid params" do
      post :create, question: {title: "valid", content: "this is content"}
      expect(Question.find(assigns[:question].id)).to be true
      end

      it "doesn't create a question when params are invalid" do
        post :create, question: {title: "invalid", content: ""}
        expect(Question.find(assigns[:question].id)).to be false
      end<commit_msg>Write get index spec for questions controller<commit_after>require 'rails_helper'

  describe QuestionsController do

    describe 'GET #index' do 

      it "populates an array of questions" do
        question = FactoryGirl.create(:question)
        get :index
        expect(assigns(:questions)).to eq([question])
      end

{'fraction_non_alphanumeric': 0.10010214504596528, 'fraction_numerical': 0.0, 'mean_word_length': 2.9357429718875503, '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': '4663552', 'n_tokens_mistral': 279, 'n_tokens_neox': 261, 'n_words': 92}