Sha256: 53003c67314b675312d73f48ea274af70822714c50901c61cb0f0a457a2bf2b9

Contents?: true

Size: 613 Bytes

Versions: 2

Compression:

Stored size: 613 Bytes

Contents

# Helpers to stub out parts of Spree
module SpreeStubs
  # Fakes a user with an order.
  # It allows us to not have to click through the entire checkout process
  # just to get a user with a session and an order.
  def stub_user_with_order(user, order)
    allow_any_instance_of(Spree::CheckoutController).
      to receive(:current_order).
      and_return(order)
    allow_any_instance_of(Spree::CheckoutController).
      to receive(:try_spree_current_user).
      and_return(user)
    allow_any_instance_of(Spree::OrdersController).
      to receive(:try_spree_current_user).
      and_return(user)
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
spree_billing_sisow-0.9.2 spec/support/spree/spree_stubs.rb
spree_billing_sisow-0.9.1 spec/support/spree/spree_stubs.rb