An example of pusher-fake with RSpec to test a Rails application.
JavaScript Ruby HTML
Switch branches/tags
Nothing to show
Permalink
Failed to load latest commit information.
app Update dependencies. Aug 12, 2016
bin Update Rails configuration. Jan 10, 2015
config Update dependencies. Nov 1, 2017
public Initial commit. Feb 11, 2012
spec Switch from capybara-webkit to poltergeist. Dec 28, 2016
.gitignore Initial commit. Feb 11, 2012
.travis.yml
Gemfile Update dependencies. Nov 2, 2017
Gemfile.lock Update dependencies. Nov 2, 2017
LICENSE Update LICENSE date. Jun 10, 2014
README.markdown Replace Cucumber with RSpec features. Jan 10, 2015
Rakefile Single to double quotes. Mar 15, 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.