Skip to content
An example of pusher-fake with RSpec to test a Rails application.
JavaScript Ruby HTML
Latest commit 43c6e54 Mar 9, 2016 @pik pik committed with Update Pusher JS client library.


pusher-fake-example Build Status Dependency Status

An example of using pusher-fake with RSpec to test a Rails application.


1. Use the PusherFake JS for the Pusher JS instance.

  <% if defined?(PusherFake) %>
    // Test environment.
    // Note: Ensure output is not HTML escaped, such as with the raw helper in Rails.
    var instance = <%= PusherFake.javascript %>;
  <% else %>
    // Other environments, such as production.
    var instance = new Pusher(...);
  <% end %>

2. Configure and start PusherFake in your RSpec environment.

require "pusher-fake/support/rspec"

3. Enjoy testing your Pusher application!


pusher-fake-example uses the MIT license. See LICENSE for more details.

Something went wrong with that request. Please try again.