Skip to content

Commit

Permalink
Fix id-dependant promotion code spec failure
Browse files Browse the repository at this point in the history
This spec wasn't testing what it was intending to. The "code" it was
submitting wasn't a string, but a Spree::PromotionCode record. Our route
helper helpfully called to_param to submit the PromotionCode's id.

This spec only passed when the promotion_code id matched the promotion
id.
  • Loading branch information
jhawthorn committed Feb 16, 2018
1 parent 5fedcf4 commit 2f1f64c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion api/spec/requests/spree/api/promotions_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ module Spree
end

context 'when finding by code' do
let(:id) { promotion.codes.first }
let(:id) { promotion.codes.first.value }

it_behaves_like "a JSON response"
end
Expand Down

0 comments on commit 2f1f64c

Please sign in to comment.