Andrew Premdas
2009-Mar-13 10:50 UTC
[rspec-users] [webrat] click link by title doesn''t work
Webrat 0.4.2 doesn''t seem to allow you to click links by title. Am I missing 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]") end When /^I follow view (\w+) details link$/ do |object| click_link "#{object}_details}" end 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 Cheers Andrew -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/rspec-users/attachments/20090313/4f7ae199/attachment.html>
Balint Erdi
2009-Mar-14 19:28 UTC
[rspec-users] [webrat] click link by title doesn''t work
Andrew Premdas wrote:> > When /^I follow view (\w+) details link$/ do |object| > click_link "#{object}_details}" > endI 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" end Does this solve your problem? Balint -- Posted via http://www.ruby-forum.com/.
Andrew Premdas
2009-Mar-14 19:54 UTC
[rspec-users] [webrat] click link by title doesn''t work
Doh!, thanks alot :). 2009/3/14 Balint Erdi <lists at ruby-forum.com>> 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" > end > > Does this solve your problem? > Balint > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/rspec-users/attachments/20090314/9494016c/attachment-0001.html>