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
有人能解释这里究竟发生了什么问题,我可能会做些什么来补救它?