Sadece RSpec ve Cabybara'nın ne kadar havalı olduğunu öğrendim ve şimdi gerçek testi yazmayı öğrenmek için etrafta çalışıyorum.RSpec ve Capybara (Rails) ile Test Yönlendirme
Bir bağlantıyı tıkladıktan sonra, belirli bir sayfaya yönlendirme olup olmadığını kontrol etmeye çalışıyorum. Aşağıda
1) I have a page /projects/list - I have an anchor with html "Back" and it links to /projects/show Below is the test i wrote in rspec describe "Sample" do describe "GET /projects/list" do it "sample test" do visit "/projects/list" click_link "Back" assert_redirected_to "/projects/show" end end end
testi
Failure/Error: assert_redirected_to "/projects/show" ArgumentError: @request must be an ActionDispatch::Request
i yanlış yapıyorum yönlendirmeyi test etmek ve gerektiği konusunda beni önermek Lütfen aşağıdaki gibi bir hata mesajı ile başarısız senaryodur?
'project_path' kullanmak daha iyi olabilir mi? Ve belki de 'bekle' notasyonu kullanırken, – SuckerForMayhem