0
只是學習RSpec並試圖做一些教程。在其中一個教程中,提供了以下標準。我將編寫測試和代碼以使其通過。我只是在學習Ruby和RSpec。根據規格類型,我在哪裏可以找到用於編寫RSpec測試的'食譜'?RSpec食譜?
的規格:
A person should save correctly
A person should have many addresses
A person's address must have a street, city, and zip
A person's address can have an optional country
If the 'country' is left blank, it should default to 'USA' prior to saving
非常好,謝謝。 – basheps
但是跳過控制器規格 - 他們沒有測試你真正關心的 - 並使用Cucumber代替。 –
@ MarnenLaibow-Koser取決於 - 高層次的行爲是很好的考驗;視圖層取決於控制器,但具有不同的特性。 –