Guest User

Untitled

a guest
Jun 19th, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.85 KB | None | 0 0
  1. ## Inventory Unit Test
  2. require 'test_helper'
  3.  
  4. class InventoryTest < ActiveSupport::TestCase
  5.  
  6. should_belong_to :product
  7. should_belong_to :warehouse
  8.  
  9. context "Inventory" do
  10. setup do
  11. @inventory = inventories(:nashville_bct30ma)
  12. end
  13.  
  14. should "have a quantity on hand" do
  15. assert_equal 100, @inventory.quantity_on_hand
  16. assert_equal @inventory.product.model, products(:bct30ma).model
  17. end
  18. end
  19. end
  20.  
  21.  
  22. ## Inventory Fixture
  23. nashville_bct30ma:
  24. warehouse: nashville
  25. product: bct30ma
  26. quantity_on_hand: 100
  27.  
  28. ## Product Fixture
  29. bct30ma:
  30. id: 1
  31. model: BCT30MA//F
  32. internal_reference: VSP-BCT-30MA
  33. brand_id: 1
  34. classification_id: 1
  35. permalink: sony-bct-30ma
  36. weight: 0.68
  37. state: active
  38. invoice_description: "Really popular Betacam tape."
  39. text_description: "Really popular Betacam tape."
Add Comment
Please, Sign In to add comment