forked from rubyforgood/human-essentials
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvendor_spec.rb
More file actions
35 lines (32 loc) · 924 Bytes
/
vendor_spec.rb
File metadata and controls
35 lines (32 loc) · 924 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# == Schema Information
#
# Table name: vendors
#
# id :bigint not null, primary key
# address :string
# business_name :string
# comment :string
# contact_name :string
# email :string
# latitude :float
# longitude :float
# phone :string
# created_at :datetime not null
# updated_at :datetime not null
# organization_id :integer
#
RSpec.describe Vendor, type: :model do
it_behaves_like "provideable"
context "Methods" do
describe "volume" do
it "retrieves the amount of product that has been bought from this vendor" do
vendor = create(:vendor)
create(:purchase, :with_items, item_quantity: 10, amount_spent_in_cents: 1, vendor: vendor)
expect(vendor.volume).to eq(10)
end
end
end
describe "versioning" do
it { is_expected.to be_versioned }
end
end