[rspec-users] [cucumber] Assertions about current location in Then steps

Tim Fischbach info at timfischbach.de
Sun May 3 14:28:12 EDT 2009


is there currently a way to make assertions about the current location
in Then steps? Here's an example of what I would like to do:

  Scenario: Creating a post
    Given I am on the the posts page
    When I fill in ...
    And ...
    Then I should be on the homepage

I have seen many cases where the last assertion is replaced by a 'Then I
should see "<something that is on the expected page>"'. But I can't help
but feel that depending on the specific wording is way to brittle. And
since I could also check the current location by looking at the address
bar (if I ran the test manually) I guess it would not be a violation if
cucumber did (as opposed to checking for records in the database etc).



More information about the rspec-users mailing list