我rspec的標題測試與故障: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
我的HomeController具有:
DEF指數() @title = 「TitleTest」 端
我的視圖(application.html.erb )有:
<title><%= @title %></title>
運行rails服務器顯示我的標題確實設置,這裏有什麼問題?