trotzig/diffux — pull request #110 by flarnie (2014-04-19 22:18:33+00:00)
Title: Testing keyboard shortcuts

*Note*: I know that maintainers (@trotzig and @lencioni) are relatively busy this weekend, so I understand if this pull request doesn't get reviewed right away. Thanks again for your time in commenting on and merging my previous pull requests.

Nearly all changes/additions from this are in `spec/features/keyboard_shortcuts_spec.rb`, along with some changes to `spec/spec_helper.rb`.
The point of this pull request is to add some intial integration tests of JS, to support future refactoring and adding to the JS in this project.

Summary of changes:
- Adds `poltergeist` gem and custom tag for configuring DB transactions for a given block of specs
- Adds the `spec/features` directory for future integration specs
- Adds a hack (see `app/assets/javascripts/_phantomJS-configs.js`) to deal with an issue with phantomJS and the nonstandard `click` method on DOM elements in JS. The code in this file is only loaded when phantom JS is running in the browser, and has no effect on the live functionality of JS in the project.
- Adds basic tests for all currently implemented keyboard shortcuts. ('?', 'k', 'j', 'gg', 'G', 'o', 'u', 'a', 'r', '[', ']', and 'x' at time of writing)