0
我原以爲這個測試會通過。任何想法爲什麼它不是?簡單的rspec測試失敗
it 'should create an account' do
visit new_user_registration_path
fill_in 'user_email', with: '[email protected]'
fill_in 'user_password', with: 'testing123'
fill_in 'user_password_confirmation', with: 'testing123'
expect{
click_button 'Sign Up'
}.to change{User.count}.by(1)
end
我只是得到
result should have been changed by 1, but was changed by 0
您確定在註冊過程中沒有錯誤嗎? current_path在註冊步驟後會給你什麼? – usha
完全相同的例子在我的應用程序(與設計)工作。也許你的用戶有任何其他驗證要求?當你將這些步驟設置爲manualy時,一切正常? – Adeptus