Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How can i stub a cart? #32

Open
jpaulo opened this issue Apr 14, 2015 · 0 comments
Open

How can i stub a cart? #32

jpaulo opened this issue Apr 14, 2015 · 0 comments

Comments

@jpaulo
Copy link

jpaulo commented Apr 14, 2015

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!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant