1

我正在使用黄瓜和水豚以及 rails 2.3.9。

如何验证页面标题?我尝试为每个 GET 请求设置一个好的页面标题,并希望在我的黄瓜测试中验证这一点。

4

1 回答 1

3

知道了。

Then /^I should see page title as "(.*)"$/ do |title|
  assert_equal title, page.find(:css, 'title').text
end
于 2010-09-12T21:36:45.980 回答