Sha256: 5fc88aa17d70163aecd3f1a0dc62171d4c27811475eabb615e47cbdf041e6b6e

Contents?: true

Size: 513 Bytes

Versions: 2

Compression:

Stored size: 513 Bytes

Contents

module SimpleCart
  RSpec.describe OrderItem, type: :model do
    it 'should be a OrderItem class' do
      expect(OrderItem.is_a?(Class)).to be_truthy
      expect(OrderItem < ActiveRecord::Base).to be_truthy
    end

    it { should have_db_column(:price).of_type(:decimal) }
    it { should have_db_column(:qty).of_type(:integer) }

    it { should belong_to(:order) }
    it { should belong_to(:itemable) }

    it { should validate_presence_of(:price) }
    it { should validate_presence_of(:qty) }
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
simple_cart-0.0.5 spec/models/simple_cart/order_item_spec.rb
simple_cart-0.0.4 spec/models/simple_cart/order_item_spec.rb