John Dow
John Dow

Reputation: 1521

How to click on href using Acceptance testing w/ Rspec and Capybara

I have this content in the page source:

<td class="gridData" route="default" reset="0" urlparams="users index edit {userID}" label="Username">
<a href="/de/users/index/edit/userID/56">UM-Employee</a>
</td>

Any ideas on how to test this functionality to click on the user link?

Upvotes: 1

Views: 534

Answers (2)

Patru
Patru

Reputation: 4551

You can use the link text (as below) or an id-tag (which you would have to introduce into your HTML of course) to identify the link Capybara should follow.

Upvotes: 0

Sigurd
Sigurd

Reputation: 7963

click_link("UM-Employee")

Upvotes: 3

Related Questions