2014-01-08 77 views
1

我目前被困在9.13和9.2之間。我完全從該部分複製了規範和控制器文件,但仍然無法通過Rspec測試。得到這個錯誤 - 是否很常見?我還沒有發現它發佈在這裏。RT ch 9中未通過Rspec測試的原因不明

Failures: 

1) User_pages edit with valid information Failure/Error: it { should have_title(new_name) } expected #has_title?("New Name") to return true, got false # ./spec/requests/user_pages_spec.rb:47:in `block (4 levels) in ' 

2) User_pages edit with valid information Failure/Error: it { should have_selector('div.alert.alert-success') } expected #has_selector?("div.alert.alert-success") to return true, got false # ./spec/requests/user_pages_spec.rb:48:in `block (4 levels) in ' 

3) User_pages edit with valid information Failure/Error: specify { expect(user.reload.name).to eq new_name } 

    expected: "New Name" 
     got: "John Smith" 

    (compared using ==) 
# ./spec/requests/user_pages_spec.rb:50:in `block (4 levels) in <top (required)>' 
4) User_pages edit with valid information Failure/Error: specify { expect(user.reload.email).to eq new_email } 

    expected: "[email protected]" 
     got: "[email protected]" 

    (compared using ==) 
# ./spec/requests/user_pages_spec.rb:51:in `block (4 levels) in <top (required)>' 
Finished in 4.41 seconds 64 examples, 4 failures 

Failed examples: 

rspec ./spec/requests/user_pages_spec.rb:47 # User_pages edit with valid information rspec ./spec/requests/user_pages_spec.rb:48 # User_pages edit with valid information rspec ./spec/requests/user_pages_spec.rb:50 # User_pages edit with valid information rspec ./spec/requests/user_pages_spec.rb:51 # User_pages edit with valid information 

我已經發布了一些我的代碼在這裏:https://gist.github.com/ephunit/8293106

讓我知道,如果你想看看另一個文件吧?

PS 9.13之前的所有規格測試均爲綠色。任何幫助深表感謝。

編輯:有趣......當我做了runthrough在網頁上,點擊在WebApp設置,以更新的姿態,並嘗試保存一個新的密碼,我得到以下錯誤: 表單包含1個錯誤。 *密碼確認不能爲空

即使我嘗試輸入新的密碼。同樣的錯誤,如果我只是把原來的密碼。這可能是我失敗的原因。

+0

是'champion @ aol.com'你的工廠創建了什麼,這意味着它永遠不會被更新? – Doon

+0

嘗試手動運行Web應用程序,看起來您在更新時發生錯誤,檢查日誌,以查看它未更新的原因。 – Doon

+0

John Smith和[email protected]是我在網站上爲「用戶1」輸入的名稱 – user3174983

回答

0

Spec_error

1) User_pages edit with valid information Failure/Error: it { should have_title(new_name) } expected #has_title?("New Name") to return true, got false # ./spec/requests/user_pages_spec.rb:47:in `block (4 levels) in ' 

這個問題,當你不把一般發生{標題:申請}像代碼在你視圖/靜態頁面的頂部(爲前:標題:關於頁面的約)。我不知道確切的一段代碼,但是我遇到了同樣的問題,並使用此解決方案進行了解決。