mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-05 22:26:07 +00:00
Replace expecting method call with outcome
This is more realistic and robust. Don't mock the class under test (even though `touch` is actually provided by Active Record).
This commit is contained in:
@@ -220,8 +220,12 @@ RSpec.describe Spree::Order do
|
||||
subject(:order) { Spree::Order.create }
|
||||
|
||||
it "should set completed_at" do
|
||||
expect(order).to receive(:touch).with(:completed_at)
|
||||
order.finalize!
|
||||
expect {
|
||||
order.finalize!
|
||||
order.reload
|
||||
}.to change {
|
||||
order.completed_at
|
||||
}.from(nil)
|
||||
end
|
||||
|
||||
it "should sell inventory units" do
|
||||
|
||||
Reference in New Issue
Block a user