[rspec-users] minimise scenarios

aidy lewis aidy.lewis at googlemail.com
Mon Jun 16 07:27:19 EDT 2008


Hi,

I have a number of scenarios that are virtually the same apart from
one piece of test data

  Scenario: The user is returned search links with expected search
text description
    Given a logged in xx user
    When clicks 'Advanced Search'
    And enters 'Aidy' in the Contributors field
    And clicks search
    Then the resultant links are displayed with the search text in
each description

So, in the first clause of the When method, I would like to change the
string value.

Is there any way of doing this better than copying and pasting the
above Scenario with one different string value and re-running that
test?

Regards

Aidy


More information about the rspec-users mailing list