Sha256: 4ca2a789e1d0638b69c1421b83a7fca2fbbcb5305de9803a832ad84770e2537a

Contents?: true

Size: 1.13 KB

Versions: 9

Compression:

Stored size: 1.13 KB

Contents

describe Unidom::Shopping::ShoppingCart, type: :model do

  before :each do
  end

  after :each do
  end

  context do

    model_attributes = {
      shopper_id:   SecureRandom.uuid,
      shopper_type: 'Unidom::Shopping::Shopper',
      shop_id:      SecureRandom.uuid,
      shop_type:    'Unidom::Shopping::Shop'
    }

    it_behaves_like 'Unidom::Common::Concerns::ModelExtension', model_attributes

    shopping_item_1_attributes = {
      shopper_id:       SecureRandom.uuid,
      shopper_type:     'Unidom::Shopping::Shopper',
      shopped_id:       SecureRandom.uuid,
      shopped_type:     'Unidom::Shopping::Shopped',
      unit_price:       12.00,
      quantity:         5.00
    }

    shopping_item_2_attributes = {
      shopper_id:       SecureRandom.uuid,
      shopper_type:     'Unidom::Shopping::Shopper',
      shopped_id:       SecureRandom.uuid,
      shopped_type:     'Unidom::Shopping::Shopped',
      unit_price:       19.98,
      quantity:         2.00
    }

    it_behaves_like 'has_many', model_attributes, :items, Unidom::Shopping::ShoppingItem, [ shopping_item_1_attributes, shopping_item_2_attributes ]

  end

end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
unidom-shopping-2.0.1 lib/rspec/models/unidom/shopping/shopping_cart_spec.rb
unidom-shopping-2.0 lib/rspec/models/unidom/shopping/shopping_cart_spec.rb
unidom-shopping-1.7.8 lib/rspec/models/unidom/shopping/shopping_cart_spec.rb
unidom-shopping-1.7.7 lib/rspec/models/unidom/shopping/shopping_cart_spec.rb
unidom-shopping-1.7.6 lib/rspec/models/unidom/shopping/shopping_cart_spec.rb
unidom-shopping-1.7.5 lib/rspec/models/unidom/shopping/shopping_cart_spec.rb
unidom-shopping-1.7.4 lib/rspec/models/unidom/shopping/shopping_cart_spec.rb
unidom-shopping-1.7.3 lib/rspec/models/unidom/shopping/shopping_cart_spec.rb
unidom-shopping-1.7.2 lib/rspec/models/unidom/shopping/shopping_cart_spec.rb