所以我使用rspec
來測試我的代碼,因爲我正在經歷Rails Tutorial,當我在listing 3.20中測試代碼時,我一直收到這個錯誤。當我用眼球看着它時,所有東西都會檢查出來,但RSpec似乎並不喜歡它。RSpec沒有任何明顯的原因
(請注意,我只是做了其中一個頁面,而不是三個,因爲他們都給予同樣的錯誤)
[email protected]:~/rails_projects/sample_app$ rspec spec/controllers/pages_controller_spec.rb
F...
Failures:
1) PagesController should have the right title Failure/Error: response.should have_selector("title", expected following output to contain a | Home tag: # ./spec/controllers/pages_controller_spec.rb:13:in `block (2 levels) in '
Finished in 0.97999 seconds 4 examples, 1 failure
[email protected]:~/rails_projects/sample_app$
不要聽起來像一個白癡,但我的規格文件沒有**或**'@ base_title' - 沒有那樣的東西。 – jrg 2011-02-23 01:29:43
對不起,我的壞,我看錯了。規範在3.19節? – zetetic 2011-02-23 01:33:13
這並沒有回答,但它使我正確的方向來解決它。乾杯! – jrg 2011-02-26 13:29:01