<commit_before>require 'rails_helper'

RSpec.feature "Questions", type: :feature do
  scenario 'Clicking on "Ask Question" button' do
    visit questions_path
    click_link 'Ask Question'
    expect(current_path).to eq(new_question_path)
  end

  scenario 'Creating a new question' do
    visit new_question_path
    within('#question-form') do
      fill_in 'Title', with: 'Question one?'
      fill_in 'Description', with: 'I really need help in this problem.'
    end
    click_button 'Ask!'
    expect(page).to have_content 'Question created.'
  end
end<commit_msg>Added questions index feature test.<commit_after>require 'rails_helper'

RSpec.feature "Questions", type: :feature do
  scenario 'Clicking on "Ask Question" button' do
    visit questions_path
    click_link 'Ask Question'
    expect(current_path).to eq(new_question_path)
  end

  scenario 'Creating a new question' do
    visit new_question_path
    within('#question-form') do
      fill_in 'Title', with: 'Question one?'
      fill_in 'Description', with: 'I really need help in this problem.'
    end
    click_button 'Ask!'
    expect(page).to have_content 'Question created.'
  end

  xfeature 'Viewing questions' do
    let(:title_1) { 'Question 1' }
    let(:title_2) { 'Question 2' }

    background do
      FactoryGirl.create :question, title: title_1
      FactoryGirl.create :question, title: title_2
    end

    scenario 'Viewing created questions' do
      visit questions_path
      expect(page).to have_content(title_1)
      expect(page).to have_content(title_2)
    end
  end
end
{'fraction_non_alphanumeric': 0.0910828025477707, 'fraction_numerical': 0.005095541401273885, 'mean_word_length': 3.634218289085546, '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': '6590025', 'n_tokens_mistral': 485, 'n_tokens_neox': 470, 'n_words': 149}