Hello,
in the process of implementing a rspec test for my controller, i need to stub a shopping cart, so that my "method" doesn't fail because of an empty cart. Is that possible? I've been trying to do something like
allow_any_instance_of(CartItem).to receive(quantity: 1, item_type: "FrameItem", price: 60)
but this give me errors like " CartItem does not implement #quantity". Surely i am doing something wrong. Appreciate the help!!
Hello,
in the process of implementing a rspec test for my controller, i need to stub a shopping cart, so that my "method" doesn't fail because of an empty cart. Is that possible? I've been trying to do something like
but this give me errors like " CartItem does not implement #quantity". Surely i am doing something wrong. Appreciate the help!!