Forum: Ruby Testing multiple page actions in Rails

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Ccfe7d097475a32dc3ff78d6fc42c852?d=identicon&s=25 listrecv (Guest)
on 2005-11-22 17:54
(Received via mailing list)
Some actions in Rails require sessions spanning multiple pages.  Things
like "login & check account" or "fill a shopping cart and check out".

I'm having trouble creating functional testing for these for two
reasons:

1) The post() etc. methods seem to reset the session each time.

2) How do you create a functional test that accesses multiple
controllers?

Specifically, could someone post a functional test to a controller that
requires the user be logged in first?

Thanks.
33ec7e55a251c1be8d6febfd929aebbe?d=identicon&s=25 Greg Kujawa (gregarican)
on 2005-11-22 17:58
(Received via mailing list)
listr...@gmail.com wrote:

>
> 2) How do you create a functional test that accesses multiple
> controllers?
>
>
> Specifically, could someone post a functional test to a controller that
> requires the user be logged in first?
>
>
> Thanks.


You might have better results posting this to the Rails mailing list at

http://lists.rubyonrails.org/mailman/listinfo.
Ccfe7d097475a32dc3ff78d6fc42c852?d=identicon&s=25 listrecv (Guest)
on 2005-11-22 19:51
(Received via mailing list)
I took a look at some RoR projects, to see how they do this.

Many just set the session explicilty, to simulate what it would look
like in the middle.

I don't like this, because it couples the test to the implementation of
what's stored in the session.  It would be much better to have a tester
that can span multiple requests.
This topic is locked and can not be replied to.