【发布时间】:2010-12-02 03:35:33
【问题描述】:
我的 rspec 标题测试失败:
1) HomeController Get 'index should have the right title
Failure/Error: response.should have_selector("title",
expected following output to contain a <title>TitleTest</title> tag:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
# ./spec/controllers/home_controller_spec.rb:13
我的家庭控制器有:
定义索引() @title = "标题测试" 结束
我的观点(application.html.erb)有:
<title><%= @title %></title>
运行 rails 服务器显示我的标题确实设置好了,这里有什么问题?
【问题讨论】:
标签: ruby-on-rails rspec