2
這個失敗的測試通過我的本地,但在我的遠程測試服務器上失敗。所以我猜想這可能是有關遠程Redis的/ resque配置..Rails錯誤期望是什麼意思?
我的錯誤讀取像這樣:
not all expectations were satisfied
unsatisfied expectations:
- expected exactly once, not yet invoked: Resque Client connected to redis://localhost:6379/0.enqueue(StoreArticulate::Bookmarks, 10, 'SecondBookmark000011101010101')
satisfied expectations:
- allowed any number of times, not yet invoked: #<Mock:generic pusher channel>.trigger(any_parameters)
- allowed any number of times, not yet invoked: Pusher.[](any_parameters)
- allowed any number of times, not yet invoked: Panda::Video.find(any_parameters)
- allowed any number of times, not yet invoked: Resque Client connected to redis://localhost:6379/0.enqueue(any_parameters)
test: #bookmarks should update an existing bookmark. (QuizzesControllerTest)
test/functional/quizzes_controller_test.rb:37:in `block (2 levels) in <class:QuizzesControllerTest>'
的代碼行,這是指內容如下:
should 'update an existing bookmark' do
Resque.stubs(:enqueue)
Resque.expects(:enqueue).with(StoreArticulate::Bookmarks, @quiz.id, @second_bookmark[0]).once
post :state, registration: @quiz.id, method: 'POST', content: @first_bookmark
post :state, registration: @quiz.id, method: 'POST', content: @second_bookmark
end
有人能解釋這裏究竟發生了什麼問題,我可能會做些什麼來補救它?