ankane/ahoy — pull request #56 by krln (2014-11-26 16:06:21+00:00)
Title: Initial test suite for Ahoy engine.

Hello!

I've worked with Ahoy a lot as a part of my Rails Girls Summer of Code work on Species+ project. It's a great gem, but I noticed it could use some tests. So here they are :)

Went with the standard Rails engine testing approach, i.e. "dummy" app stored inside `spec/` which is a minimal Rails app utilizing the engine.

Contains:
* rspec environment with standard dummy app
* test for `Ahoy::EventsController` (one used by javascript api)
* test for `ahoy.track` in Rails app's controller
* test for `Ahoy::VisitsController`
* `.travis.yml` file

I'm not sure if `.travis.yml` is going to run the suite out-of-the-box, it might need an extra `before_script` step for building the dummy app's test database. There's only one way to find out (due to historical reasons .travis.yml needs to be in master first)!

If these tests are not enough or not the way you'd prefer them to be, I'd be happy to learn.