Skip to content

Commit

Permalink
Improve order checkout specs' performance
Browse files Browse the repository at this point in the history
  • Loading branch information
arku committed Oct 1, 2020
1 parent b850f10 commit 350a3c0
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions spec/models/spree/order/checkout_spec.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
require 'spec_helper'

describe Spree::Order do
describe Spree::Order::Checkout do
let(:order) { Spree::Order.new }

context "with default state machine" do
Expand All @@ -15,8 +15,6 @@

it "has the following transitions" do
transitions.each do |transition|
puts transition.keys.first
puts transition.values.first
transition = Spree::Order.find_transition(from: transition.keys.first,
to: transition.values.first)
expect(transition).to_not be_nil
Expand Down Expand Up @@ -302,12 +300,12 @@ class SubclassedOrder < Spree::Order
end

describe 'event :restart_checkout' do
let(:order) { create(:order) }
let(:order) { build_stubbed(:order) }

context 'when the order is not complete' do
before { allow(order).to receive(:completed?) { false } }

it 'does transition to cart state' do
it 'transitions to cart state' do
expect(order.state).to eq('cart')
end
end
Expand Down

0 comments on commit 350a3c0

Please sign in to comment.