[rspec-users] Can't test for page content after a redirect

Christian Lescuyer lists at ruby-forum.com
Thu Aug 7 14:44:27 EDT 2008


I'm trying to verify that data entered in a form has been saved in the
database.

  Scenario: User enters a bookmark URL
    Given a bookmark 'http://www.gotapi.com/rubyrails'
    When the user adds the bookmark
    Then should redirect to '/'
    And the page should contain 'http://www.gotapi.com/rubyrails'

The first test (should redirect) passes. The second fails. I understand
why: the page that is analysed is a dummy page "You are being
redirected."

Is it possible to check data in the second page?

Cheers
Xtian
-- 
Posted via http://www.ruby-forum.com/.


More information about the rspec-users mailing list