<commit_before>require 'spec_helper'

describe Spree::Adjustment do

  context "factory_girl" do
    before do
      Spree::Order.delete_all
      @order = Factory(:order)
      @adjustment = Factory(:adjustment, :order => @order)
    end
    it 'should refer to the order that was passed to the factory' do
      @adjustment.order.id.should == @order.id
    end
  end

  let(:order) { mock_model(Spree::Order, :update! => nil) }
  let(:adjustment) { Spree::Adjustment.new }
  it "should accept a negative amount"

  context "#update!" do
    context "when originator present" do
      let(:originator) { mock("originator", :update_adjustment => nil) }
      before do
        originator.stub :update_amount => true
        adjustment.stub :originator => originator
      end
      it "should do nothing when locked" do
        adjustment.locked = true
        originator.should_not_receive(:update_adjustment)
        adjustment.update!
      end
      it "should set the eligibility" do
        adjustment.should_receive(:set_eligibility)
        adjustment.update!
      end
      it "should ask the originator to update_adjustment" do<commit_msg>[core] Don't test basic factory behaviour in adjustment_spec<commit_after>require 'spec_helper'

describe Spree::Adjustment do

  let(:order) { mock_model(Spree::Order, :update! => nil) }
  let(:adjustment) { Spree::Adjustment.new }
  it "should accept a negative amount"

  context "#update!" do
    context "when originator present" do
      let(:originator) { mock("originator", :update_adjustment => nil) }
      before do
        originator.stub :update_amount => true
        adjustment.stub :originator => originator
      end
      it "should do nothing when locked" do
        adjustment.locked = true
        originator.should_not_receive(:update_adjustment)
        adjustment.update!
      end
      it "should set the eligibility" do
        adjustment.should_receive(:set_eligibility)
        adjustment.update!
      end
      it "should ask the originator to update_adjustment" do
{'fraction_non_alphanumeric': 0.09237536656891496, 'fraction_numerical': 0.0, 'mean_word_length': 3.094, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 12, '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': '505408', 'n_tokens_mistral': 597, 'n_tokens_neox': 580, 'n_words': 170}