0
我開始學習TDD使用RSpec和水豚用Rails 4.到目前爲止,它很順利訪問X {訪問X}之間和之前的區別。但我有個問題。是什麼在rspec的
當我想測試某個頁面,如果有正確的標題,我寫:
describe "page information" do
before { visit root_path }
it { should have_title(full_title('Test title')) }
end
但是,如果我改變before{ visit root_path }
到visit root_path
,它會引發錯誤。爲什麼是這樣?在其他測試中,我不必寫before X
。
在此先感謝。
這正是我的意思,謝謝! –