Forum: RSpec [webrat] click link by title doesn't work

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
85d99e7678d8720f6e00ab0f60fe6ea9?d=identicon&s=25 Andrew Premdas (Guest)
on 2009-03-13 12:00
(Received via mailing list)
Webrat 0.4.2 doesn't seem to allow you to click links by title. Am I
something stupid?
With steps below running in sequence, first passes, second fails

Then /^I should see a view (\w+) details link$/ do |object|
  response.should have_tag("a[title=#{object}_details]")

When /^I follow view (\w+) details link$/ do |object|
  click_link "#{object}_details}"

I think click link should find by

- innerHTML, with simple   handling
-  title
-  id
-  class

Does anyone have any contradictory opinions?

In the meantime I'll have a bash at writing a patch for this


A4911c2072d2c07e17d79c47559b4767?d=identicon&s=25 Balint Erdi (balint)
on 2009-03-14 20:28
Andrew Premdas wrote:

> When /^I follow view (\w+) details link$/ do |object|
>   click_link "#{object}_details}"
> end

I think the problem is that you have an extra } in the title of the link
you are looking for. It should just be:

When /^I follow view (\w+) details link$/ do |object|
  click_link "#{object}_details"

Does this solve your problem?
85d99e7678d8720f6e00ab0f60fe6ea9?d=identicon&s=25 Andrew Premdas (Guest)
on 2009-03-14 21:05
(Received via mailing list)
Doh!, thanks alot :).

2009/3/14 Balint Erdi <>
This topic is locked and can not be replied to.