Ruby on Rails:黄瓜:我如何关注链接

时间:2012-06-15 15:41:36

标签: ruby-on-rails cucumber

我的页面上有一个链接,可以带您到两个不同的地方 如果它是您第一次按下该链接,它会将您带到新操作,所有其他时间将进行更新,但两个链接都具有相同的文本。

When /^I follow "(.*?)"$/ do |arg1|
  ???
end

1 个答案:

答案 0 :(得分:3)

o.k链接的相同文字:

When /^I follow "(.*?)"$/ do |arg1|
      click_link "Follow"
end

Then /^he should see hello message$/ do
  page.should have_selector('div.hello')
end