Skip to content

Commit

Permalink
Rename variable in spec
Browse files Browse the repository at this point in the history
Make it more readable.
  • Loading branch information
jordan-brough committed Sep 19, 2016
1 parent 4ad15d5 commit 8f8a2f0
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,20 +62,19 @@
let(:action) { promotion.actions.first! }
let(:promotion) { create(:promotion, :with_order_adjustment) }

# this adjustment should not get removed
let!(:other_adjustment) { create(:adjustment, order: order, source: nil) }
let!(:unrelated_adjustment) { create(:adjustment, order: order, source: nil) }

before do
action.perform(payload)
@action_adjustment = order.adjustments.where(source: action).first!
end

it 'removes the action adjustment' do
expect(order.adjustments).to match_array([other_adjustment, @action_adjustment])
expect(order.adjustments).to match_array([unrelated_adjustment, @action_adjustment])

action.remove_from(order)

expect(order.adjustments).to eq([other_adjustment])
expect(order.adjustments).to eq([unrelated_adjustment])
end
end

Expand Down

0 comments on commit 8f8a2f0

Please sign in to comment.