<commit_before>feature 'Blog Posts' do
  scenario 'user create blog post' do
    FactoryGirl.create(:user)

    visit(new_blog_post_path)

    expect(page.status_code).to eq(200)

    fill_in(:blog_post_title, with: 'New Post Title')
    fill_in(:blog_post_body, with: 'New Post Body')
    choose('blog_post_user_id_1')

    click_button('Submit')

    expect(page.current_path).to eq(blog_posts_path)
    expect(page).to have_content('New Post Title')
    expect(page).to have_content('New Post Body')
    expect(page).to have_content(
      I18n.t('adminable.resources.created', resource: 'Post')
    )
  end

  scenario 'user update blog post' do
    blog_post = FactoryGirl.create(:blog_post)

    visit(edit_blog_post_path(blog_post))

    expect(page.status_code).to eq(200)

    fill_in(:blog_post_title, with: 'Another Post Title')
    fill_in(:blog_post_body, with: 'Another Post Body')

    click_button('Submit')

    expect(page.current_path).to eq(blog_posts_path)
    expect(page).to have_content('Another Post Title')
    expect(page).to have_content('Another Post Body')
    expect(page).to have_content(
      I18n.t('adminable.resources.updated', resource: 'Post')
    )
  end

  scenario 'user delete blog post' do
    FactoryGirl.create(:blog_post)

    visit(blog_posts_path)

    expect(page.status_code).to eq(200)
<commit_msg>Add errors to blog post spec<commit_after>feature 'Blog Posts' do
  feature 'user creates blog post' do

    before do
      FactoryGirl.create(:user)
      visit(new_blog_post_path)
      expect(page.status_code).to eq(200)
    end

    scenario 'with required fields' do
      fill_in(:blog_post_title, with: 'New Post Title')
      fill_in(:blog_post_body, with: 'New Post Body')
      choose('blog_post_user_id_1')

      click_button('Submit')

      expect(page.current_path).to eq(blog_posts_path)
      expect(page).to have_content('New Post Title')
      expect(page).to have_content('New Post Body')
      expect(page).to have_content(
        I18n.t('adminable.resources.created', resource: 'Post')
      )
    end

    scenario 'without required fields' do
      click_button('Submit')

      expect(page.current_path).to eq(blog_posts_path)
      expect(page).to have_content("Title can't be blank")
    end
  end

  feature 'user updates blog post' do
    before do
      blog_post = FactoryGirl.create(:blog_post)
      visit(edit_blog_post_path(blog_post))
      expect(page.status_code).to eq(200)
    end

    scenario 'with required fields' do
      fill_in(:blog_post_title, with: 'Another Post Title')
      fill_in(:blog_post_body, with: 'Another Post Body')

      click_button('Submit')

      expect(page.current_path).to eq(blog_posts_path)
      expect(page).to have_content('Another Post Title')
      expect(page).to have_content('Another Post Body')
      expect(page).to have_content(
        I18n.t('adminable.resources.updated', resource: 'Post')
      )
    end

    scenario 'without required fields' do
      fill_in(:blog_post_title, with: '')

      click_button('Submit')

      expect(page).to have_content("Title can't be blank")
    end
  end

  scenario 'user delete blog post' do
    FactoryGirl.create(:blog_post)

    visit(blog_posts_path)

    expect(page.status_code).to eq(200)

{'fraction_non_alphanumeric': 0.112568639414277, 'fraction_numerical': 0.008541793776693106, 'mean_word_length': 3.6248236953455573, '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': '4801720', 'n_tokens_mistral': 1100, 'n_tokens_neox': 1041, 'n_words': 231}