summaryrefslogtreecommitdiff
path: root/spec/models/product_spec.rb
blob: b3790fee3c37d3a59491889be93b809a0dc078cb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
# frozen_string_literal: true

require 'rails_helper'

RSpec.describe Product, type: :model do
  it { should validate_presence_of(:name) }
  it { should validate_presence_of(:unitary_price) }
  it { should validate_presence_of(:bulk_price) }
  it { should validate_presence_of(:available_quantity) }
  it { should have_one_attached(:picture) }
  it { should belong_to(:company) }
  it { should serialize(:categories) }
end