<commit_before>When(/^I void an order$/) do
  VCR.use_cassette('void_order') do
    @voided_order = ShipCompliant::VoidSalesOrder.by_order_key('ONS-1')
  end
end

When(/^I void an already void order$/) do
  VCR.use_cassette('void_voided_order') do
    @voided_order = ShipCompliant::VoidSalesOrder.by_order_key('ONS-1')
  end
end

Then(/^I should get a successful response$/) do
  @voided_order.success?.should be_true
end

Then(/^I should get an error message$/) do
  @voided_order.should == {
    response_status: 'Failure',
    errors: {
      error: {
        code: '200',
        key: 'ONS-1',
        message: 'SalesOrder does not exist [ONS-1].',
        target: 'SalesOrder',
        type: 'Validation'
      }
    }
  }
end<commit_msg>update spec to use VoidSearchOrder api<commit_after>When(/^I void an order$/) do
  VCR.use_cassette('void_order') do
    @voided_order = ShipCompliant::VoidSalesOrder.by_order_key('ONS-1')
  end
end

When(/^I void an already void order$/) do
  VCR.use_cassette('void_voided_order') do
    @voided_order = ShipCompliant::VoidSalesOrder.by_order_key('ONS-1')
  end
end

Then(/^I should get a successful response$/) do
  @voided_order.success?.should be_true
end

Then(/^I should get an error message$/) do
  @voided_order.failure?.should be_true
  @voided_order.error_count.should == 1

  error = @voided_order.errors[0]
  error.code.should == 200
  error.key.should == 'ONS-1'
  error.message.should == 'SalesOrder does not exist [ONS-1].'
  error.target.should == 'SalesOrder'
  error.type.should == 'Validation'
end
{'fraction_non_alphanumeric': 0.13397435897435897, 'fraction_numerical': 0.010256410256410256, 'mean_word_length': 3.7883435582822087, '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': '5517344', 'n_tokens_mistral': 580, 'n_tokens_neox': 555, 'n_words': 127}