Sha256: e5d3c7548d8d99a450379e2b1e5f4d98f1fe86d65f60ee327a044fc095159786
Contents?: true
Size: 1.07 KB
Versions: 13
Compression:
Stored size: 1.07 KB
Contents
# frozen_string_literal: true require 'spec_helper' describe "Cancelling + Resuming", type: :feature do stub_ability_authorization! let(:user) { create(:user) } before do allow(user).to receive(:has_spree_role?).and_return(true) allow_any_instance_of(Spree::Admin::BaseController).to receive(:try_spree_current_user).and_return(user) end let(:order) do order = create(:order) order.update_columns({ state: 'complete', completed_at: Time.current }) order end it "can cancel an order" do visit spree.edit_admin_order_path(order.number) click_button 'Cancel' within(".additional-info") do expect(find('dt#order_status + dd')).to have_content("Canceled") 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 expect(find('dt#order_status + dd')).to have_content("Resumed") end end end end
Version data entries
13 entries across 13 versions & 1 rubygems