mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-03 02:21:33 +00:00
22 lines
536 B
Ruby
22 lines
536 B
Ruby
require 'spec_helper'
|
|
|
|
module Spree
|
|
describe Distributor do
|
|
|
|
describe "associations" do
|
|
it { should belong_to(:pickup_address) }
|
|
it { should have_many(:product_distributions) }
|
|
it { should have_many(:orders) }
|
|
end
|
|
|
|
it "should default country to system country" do
|
|
distributor = Distributor.new
|
|
distributor.pickup_address.country.should == Country.find_by_id(Config[:default_country_id])
|
|
end
|
|
|
|
describe "validations" do
|
|
it { should validate_presence_of(:name) }
|
|
end
|
|
end
|
|
end
|