Skip to content

Commit

Permalink
Don't use instance variable in spec
Browse files Browse the repository at this point in the history
  • Loading branch information
kjriga committed Aug 16, 2024
1 parent 6f6dc4e commit d7e3688
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,10 @@

context "when promotion_code creation returns an error" do
before do
@raise_exception = true
raise_exception = true
allow(Spree::PromotionCode).to receive(:create!) do
if @raise_exception
@raise_exception = false
if raise_exception
raise_exception = false
raise(ActiveRecord::RecordInvalid)
else
create(:promotion_code, promotion: promotion)
Expand Down

0 comments on commit d7e3688

Please sign in to comment.