<commit_before>require "rails_helper"

RSpec.describe "Creating a budget item for a notebook" do
  let(:user) { create(:user) }
  let!(:first_notebook) { create(:notebook, name: "My first notebook", user: user) }

  before do
    sign_in_as user
  end

  describe "on the notebooks listing" do
    it "has button to create a budget item" do
      within("#notebook_#{first_notebook.id}") do
        expect(page).to have_css "a.new-budget-item", text: "Add budget item for this notebook"
      end
    end
  end
end

<commit_msg>New test scenario for creating a budget item for a specific notebook<commit_after>require "rails_helper"

RSpec.describe "Creating a budget item for a notebook" do
  let(:user) { create(:user) }
  let!(:first_notebook) { create(:notebook, name: "My first notebook", user: user) }

  before do
    sign_in_as user
  end

  describe "on the notebooks listing" do
    it "has button to create a budget item" do
      within("#notebook_#{first_notebook.id}") do
        expect(page).to have_css "a.new-budget-item", text: "Add budget item for this notebook"
      end
    end

    describe "creating a budget item" do
      before do
        within("#notebook_#{first_notebook.id}") do
          click_on "Add budget item for this notebook"
        end

        fill_in "Name", with: "Upcase Subscription (recurring)"
        fill_in "Amount", with: "1800.95"
        click_on "Add"
      end

      it "shows a successful message" do
        expect(page).to have_content "New budget item added to #{first_notebook.name}"
      end
    end
  end
end


{'fraction_non_alphanumeric': 0.09714285714285714, 'fraction_numerical': 0.0038095238095238095, 'mean_word_length': 3.082901554404145, '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': '2263907', 'n_tokens_mistral': 499, 'n_tokens_neox': 486, 'n_words': 172}