Adjustments spec, add association test

This commit is contained in:
Gaetan Craig-Riou
2023-04-04 11:06:32 +10:00
committed by Maikel Linke
parent 5064bf5383
commit 58469adfeb

View File

@@ -7,6 +7,19 @@ module Spree
let(:order) { build(:order) }
let(:adjustment) { Spree::Adjustment.create(label: "Adjustment", amount: 5) }
describe "associations" do
it { is_expected.to have_one(:metadata) }
it { is_expected.to have_many(:adjustments) }
it { is_expected.to belong_to(:adjustable) }
it { is_expected.to belong_to(:adjustable) }
it { is_expected.to belong_to(:originator) }
it { is_expected.to belong_to(:order) }
it { is_expected.to belong_to(:tax_category) }
it { is_expected.to belong_to(:tax_rate) }
end
describe "scopes" do
let!(:arbitrary_adjustment) { create(:adjustment, label: "Arbitrary") }
let!(:return_authorization_adjustment) {