<commit_before>require 'spec_helper'

include AuthenticationWorkflow

module OpenFoodNetwork
  describe OrdersAndFulfillmentsReport do
    let(:d1) { create(:distributor_enterprise) }
    let(:oc1) { create(:simple_order_cycle) }
    let(:o1) { create(:order, completed_at: 1.day.ago, order_cycle: oc1, distributor: d1) }
    let(:li1) { build(:line_item) }
    let(:user) { create(:user)}
    let(:admin_user) { create(:admin_user)}

    before { o1.line_items << li1 }

    describe "fetching orders" do
      context "as a site admin" do
        subject { PackingReport.new admin_user, {}, true }

        it "fetches completed orders" do
          o2 = create(:order)
          o2.line_items << build(:line_item)
          subject.table_items.should == [li1]
        end
<commit_msg>Fix spec to test the right report<commit_after>require 'spec_helper'

include AuthenticationWorkflow

module OpenFoodNetwork
  describe OrdersAndFulfillmentsReport do
    let(:d1) { create(:distributor_enterprise) }
    let(:oc1) { create(:simple_order_cycle) }
    let(:o1) { create(:order, completed_at: 1.day.ago, order_cycle: oc1, distributor: d1) }
    let(:li1) { build(:line_item) }
    let(:user) { create(:user)}
    let(:admin_user) { create(:admin_user)}

    before { o1.line_items << li1 }

    describe "fetching orders" do
      context "as a site admin" do
        subject { OrdersAndFulfillmentsReport.new admin_user, {}, true }

        it "fetches completed orders" do
          o2 = create(:order)
          o2.line_items << build(:line_item)
          subject.table_items.should == [li1]
        end

{'fraction_non_alphanumeric': 0.1181592039800995, 'fraction_numerical': 0.014925373134328358, 'mean_word_length': 3.3604336043360434, 'pattern_counts': {'":': 0, '<': 11, '<?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': '3633158', 'n_tokens_mistral': 528, 'n_tokens_neox': 508, 'n_words': 118}