Hi, I have an online store and I would like to simulate a complete shopping trip which involves several controllers? How can I write a test that calls actions from different controllers in a particular sequence? Something like the following which involves department, product, cart_item, and cart controllers. get department 5 check it has a link to product 4 get product 4 post cartitem/create get cart see that product 4 in in the cart Thanks, Peter
I want integration tests. Didn''t even know there were there. Thanks, Peter On 7/10/06, Peter Michaux <petermichaux@gmail.com> wrote:> Hi, > > I have an online store and I would like to simulate a complete > shopping trip which involves several controllers? How can I write a > test that calls actions from different controllers in a particular > sequence? Something like the following which involves department, > product, cart_item, and cart controllers. > > get department 5 > check it has a link to product 4 > get product 4 > post cartitem/create > get cart > see that product 4 in in the cart > > Thanks, > Peter >
This would be ... Integration tests? http://jamis.jamisbuck.org/articles/2006/03/09/integration-testing-in-rails- 1-1 The site is a bit slow right now, but the article is great. On 7/10/06 4:27 PM, "Peter Michaux" <petermichaux@gmail.com> wrote:> Hi, > > I have an online store and I would like to simulate a complete > shopping trip which involves several controllers? How can I write a > test that calls actions from different controllers in a particular > sequence? Something like the following which involves department, > product, cart_item, and cart controllers. > > get department 5 > check it has a link to product 4 > get product 4 > post cartitem/create > get cart > see that product 4 in in the cart > > Thanks, > Peter > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails-------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060711/571e9b91/attachment.html
Seemingly Similar Threads
- Newbie error: undefined local variable or method
- Can a route require POST or GET? / REST problem with routing
- Errors ... errors and errors.
- Agile Web Developement with Rails
- ArgumentError in StoreController#add_to_cart: wrong number of arguments (1 for 0)