mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-13 23:37:47 +00:00
18 lines
425 B
Ruby
18 lines
425 B
Ruby
# frozen_string_literal: true
|
|
|
|
RSpec.describe SubscriptionLineItem, model: true do
|
|
describe "validations" do
|
|
it "requires a subscription" do
|
|
expect(subject).to belong_to :subscription
|
|
end
|
|
|
|
it "requires a variant" do
|
|
expect(subject).to belong_to :variant
|
|
end
|
|
|
|
it "requires a integer for quantity" do
|
|
expect(subject).to validate_numericality_of(:quantity).only_integer
|
|
end
|
|
end
|
|
end
|