<commit_before>require 'spec_helper'

describe "Cancelling + Resuming" do
  stub_authorization!

  let(:order) do 
    order = create(:order)
    order.update_columns({
      :state => 'complete',
      :completed_at => Time.now
    })
    order
  end

  it "can cancel an order" do
    visit spree.edit_admin_order_path(order.number)
    click_button 'cancel'
    within(".additional-info") do
      within(".state") do
        page.should have_content("canceled")
      end
    end
  end

  context "with a cancelled order" do
    before do
      order.update_column(:state, 'canceled')
    end

    it "can resume an order" do
      visit spree.edit_admin_order_path(order.number)
      click_button 'resume'
      within(".additional-info") do
        within(".state") do
          page.should have_content("resumed")
        end
      end
    end
  end
end<commit_msg>update_columns does not exist in Rails 3, so use update_column instead<commit_after>require 'spec_helper'

describe "Cancelling + Resuming" do
  stub_authorization!

  let(:order) do 
    order = create(:order)
    order.update_column(:state, 'complete')
    order.update_column(:completed_at, 'complete')
    order
  end

  it "can cancel an order" do
    visit spree.edit_admin_order_path(order.number)
    click_button 'cancel'
    within(".additional-info") do
      within(".state") do
        page.should have_content("canceled")
      end
    end
  end

  context "with a cancelled order" do
    before do
      order.update_column(:state, 'canceled')
    end

    it "can resume an order" do
      visit spree.edit_admin_order_path(order.number)
      click_button 'resume'
      within(".additional-info") do
        within(".state") do
          page.should have_content("resumed")
        end
      end
    end
  end
end
{'fraction_non_alphanumeric': 0.0975609756097561, 'fraction_numerical': 0.0005543237250554324, 'mean_word_length': 2.7370600414078674, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '678612', 'n_tokens_mistral': 565, 'n_tokens_neox': 552, 'n_words': 146}