<commit_before>require 'spec_helper'

describe Product do

  before :each do
    @facility         = Factory.create(:facility)
    @facility_account = @facility.facility_accounts.create(Factory.attributes_for(:facility_account))
  end

  it "should not create using factory" do
    @product = Product.create(Factory.attributes_for(:item, :facility_account_id => @facility_account.id))
    @product.errors[:type].should_not be_nil
  end

  context 'with item' do

    before :each do
      @item = @facility.items.create(Factory.attributes_for(:item, :facility_account_id => @facility_account.id))
    end

    it "should create map to default price groups" do
      PriceGroupProduct.count.should == 2
      PriceGroupProduct.find_by_product_id_and_price_group_id(@item.id, PriceGroup.northwestern.first.id).should_not be_nil
      PriceGroupProduct.find_by_product_id_and_price_group_id(@item.id, PriceGroup.external.first.id).should_not be_nil
    end

    it 'should give correct initial order status' do
      os=OrderStatus.inprocess.first
      @item.update_attribute(:initial_order_status_id, os.id)
      @item.initial_order_status.should == os
    end

    it 'should give default order status if status not set' do
      Item.new.initial_order_status.should == OrderStatus.default_order_status
    end

  end

  it "should return all current price policies"
end
<commit_msg>change \"northwestern\" to \"base\" in spec<commit_after>require 'spec_helper'

describe Product do

  before :each do
    @facility         = Factory.create(:facility)
    @facility_account = @facility.facility_accounts.create(Factory.attributes_for(:facility_account))
  end

  it "should not create using factory" do
    @product = Product.create(Factory.attributes_for(:item, :facility_account_id => @facility_account.id))
    @product.errors[:type].should_not be_nil
  end

  context 'with item' do

    before :each do
      @item = @facility.items.create(Factory.attributes_for(:item, :facility_account_id => @facility_account.id))
    end

    it "should create map to default price groups" do
      PriceGroupProduct.count.should == 2
      PriceGroupProduct.find_by_product_id_and_price_group_id(@item.id, PriceGroup.base.first.id).should_not be_nil
      PriceGroupProduct.find_by_product_id_and_price_group_id(@item.id, PriceGroup.external.first.id).should_not be_nil
    end

    it 'should give correct initial order status' do
      os=OrderStatus.inprocess.first
      @item.update_attribute(:initial_order_status_id, os.id)
      @item.initial_order_status.should == os
    end

    it 'should give default order status if status not set' do
      Item.new.initial_order_status.should == OrderStatus.default_order_status
    end

  end

  it "should return all current price policies"
end

{'fraction_non_alphanumeric': 0.08817204301075268, 'fraction_numerical': 0.0007168458781362007, 'mean_word_length': 4.111721611721611, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '3073235', 'n_tokens_mistral': 868, 'n_tokens_neox': 843, 'n_words': 193}