ruby - Websocket Rails Rspec tests -


i have problem test message triggering controller after dispatching event. here rspec test:

  describe "product.delete"     "should trigger message"       event = create_event("product.delete", :data => "some")       expect(event.dispatch).to trigger_message :any     end   end 

here event.rb file event routing specified:

namespace :product     subscribe :delete, :to => productcontroller, :with_method => :delete_product   end 

then controller code:

class productcontroller < websocketrails::basecontroller    def delete_product     websocketrails[:product].trigger :data => "something"   end  end 

and here getting after tests run:

    should trigger message (failed - 1)  failures:    1) product.delete should trigger message      failure/error: expect(event.dispatch).to trigger_message :any        expected product.delete trigger message data, instead did not trigger message      # ./spec/requests/product.rb:11:in `block (3 levels) in <top (required)>' 

i trying strictly follow guide on websocket-rails github wiki pages. definetely there doing wrong. can @ code , advice , please.


Comments

Popular posts from this blog

apache - PHP Soap issue while content length is larger -

asynchronous - Python asyncio task got bad yield -

javascript - Complete OpenIDConnect auth when requesting via Ajax -