Michael Hartl RoR 教程第 12 章练习 #2 [英] Michael Hartl RoR tutorial chapter 12 exercise #2
本文介绍了Michael Hartl RoR 教程第 12 章练习 #2的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
对于已经完成此练习的人来说,FILL_IN 是什么:
For those who have gone through this exercise what are the FILL_IN's in:
test "feed on Home page" do
get root_path
@user.feed.paginate(page: 1).each do |micropost|
assert_match CGI.escapeHTML(FILL_IN), FILL_IN
end
end
谢谢
推荐答案
你应该将微博内容与正文响应相匹配,如下所示:
You should match micropost content with body response, it looks like this:
test "feed on Home page" do
get root_path
@user.feed.paginate(page: 1).each do |micropost|
assert_match CGI.escapeHTML(micropost.content), response.body
end
end
这篇关于Michael Hartl RoR 教程第 12 章练习 #2的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文