Skip to content

Commit

Permalink
Extend reimbursement feature spec
Browse files Browse the repository at this point in the history
Reimbursements only work if there is a user with the email address
'spree@example.com', or if you explicitly pass the creator when creating
a reimbursement.

This commit adds to the testing set-up for this spec by mocking
a signed in admin creating the reimbursement, who can be passed as the
creator.
  • Loading branch information
Graeme Nathan committed Apr 20, 2018
1 parent cecc03c commit f7cd81e
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,12 @@

before do
Spree::RefundReason.create!(name: Spree::RefundReason::RETURN_PROCESSING_REASON, mutable: false)
allow_any_instance_of(Spree::Admin::ReimbursementsController).to receive(:try_spree_current_user).
and_return(user)
end

let!(:order) { create(:shipped_order) }
let(:user) { create(:admin_user) }

# Regression test for https://github.com/spree/spree/issues/6229
it "refunds and has outstanding_balance of zero", js: true do
Expand Down

0 comments on commit f7cd81e

Please sign in to comment.