[rspec-users] testing multiple sessions in cucumber/webrat

Bart Zonneveld zuperinfinite at gmail.com
Mon Mar 2 09:15:33 EST 2009

On 28-feb-2009, at 21:04, Joe Van Dyk wrote:

> Is it possible to have a scenario where you are testing the
> interaction between two different session?

If you mean something along these lines:

User A uploads a picture,
User B logs in to see the picture uploaded by User A

that is possible.

I use this construct a lot to test-drive some revisions code I came  
up with. Something like:

Given I am logged in
And     there is an article
And    the title of the article has been modified twice
When I  compare the revisions
Then  I should see the difference in title

GIven "the title of the article has been modified twice" do
   Given "I am logged in as an editor"

   2.times do |i|
     visit edit_article_path(@article)
     fill_in "Title", :with => "Title #{i}"
     click_button "Save"

   Given "I am logged in as a writer"


More information about the rspec-users mailing list