Skip to content
An example of pusher-fake with RSpec to test a Rails application.
JavaScript Ruby HTML
Find file
Latest commit 43c6e54 Mar 9, 2016 @pik pik committed with Update Pusher JS client library.
Failed to load latest commit information.
app
bin Update Rails configuration. Jan 9, 2015
config Update Pusher JS client library. Mar 12, 2016
public Initial commit. Feb 11, 2012
spec Update dependencies. Mar 12, 2016
.gitignore Initial commit. Feb 11, 2012
.travis.yml Update Travis CI configuration and Ruby versions. Jan 9, 2015
Gemfile Update dependencies. Mar 12, 2016
Gemfile.lock Update dependencies. Mar 12, 2016
LICENSE Update LICENSE date. Jun 10, 2014
README.markdown Replace Cucumber with RSpec features. Jan 9, 2015
Rakefile Single to double quotes. Mar 14, 2012
config.ru Update Rails configuration. Jan 10, 2015

README.markdown

pusher-fake-example Build Status Dependency Status

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

How-To

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

<script>
  <% 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 %>
</script>

2. Configure and start PusherFake in your RSpec environment.

require "pusher-fake/support/rspec"

3. Enjoy testing your Pusher application!

License

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

Something went wrong with that request. Please try again.