我在模型中有以下方法:
def trigger_events_updated_push_event
Pusher['events'].trigger('events_updated', {})
end
我有以下规格:
describe '#trigger_events_updated_push_event' do
it 'should send message to Pusher' do
Pusher['events'].should_receive(:trigger).with('events_updated', {})
subject.send(:trigger_events_updated_push_event)
end
end
这会产生此错误:
Failure/Error: Unable to find matching line from backtrace
(#<Pusher::Channel:0x007ff16f18ae58>).trigger("events_updated", {})
expected: 1 time
received: 0 times
我没有做什么?