<commit_before>require 'spec_helper'
describe Spree::Order do
  let(:order) { Spree::Order.new }

  context "clear_adjustments" do

    let(:adjustment) { double("Adjustment") }

    it "destroys all order adjustments" do
      order.stub(:adjustments => adjustment)
      adjustment.should_receive(:destroy_all)
      order.clear_adjustments!
    end

    it "destroy all line item adjustments" do
      order.stub(:line_item_adjustments => adjustment)
      adjustment.should_receive(:destroy_all)
      order.clear_adjustments!
    end
  end

  context "totaling adjustments" do
    let(:adjustment1) { mock_model(Spree::Adjustment, :amount => 5) }
    let(:adjustment2) { mock_model(Spree::Adjustment, :amount => 10) }

    context "#ship_total" do
      it "should return the correct amount" do
        order.stub_chain :adjustments, :shipping => [adjustment1, adjustment2]
        order.ship_total.should == 15
      end
    end

    context "#tax_total" do
      it "should return the correct amount" do
        order.stub_chain :adjustments, :tax => [adjustment1, adjustment2]
        order.tax_total.should == 15
      end
    end
  end 

  context "line item adjustment totals" do
    before { @order = Spree::Order.create! }<commit_msg>clear_adjustments! is long gone, as is ship_total<commit_after>require 'spec_helper'
describe Spree::Order do
  let(:order) { Spree::Order.new }

  context "totaling adjustments" do
    let(:adjustment1) { mock_model(Spree::Adjustment, :amount => 5) }
    let(:adjustment2) { mock_model(Spree::Adjustment, :amount => 10) }

    context "#tax_total" do
      it "should return the correct amount" do
        order.stub_chain :adjustments, :tax => [adjustment1, adjustment2]
        order.tax_total.should == 15
      end
    end
  end 

  context "line item adjustment totals" do
    before { @order = Spree::Order.create! }
{'fraction_non_alphanumeric': 0.10748663101604278, 'fraction_numerical': 0.011764705882352941, 'mean_word_length': 3.4441805225653206, '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': '7550848', 'n_tokens_mistral': 604, 'n_tokens_neox': 568, 'n_words': 150}