puppetlabs/puppet-webhooks — pull request #17 by jeffmccune (2013-01-28 07:54:50+00:00)
Title: Move database setup to PuppetLabs::Webhook.setup_environment

Without this patch database configuration is spread out in a number of
different places. The environment rake task, the application logic
itself, and the spec helper all have different behaviors.

This is a problem because it makes it more difficult than necessary to
rig up the application into a test harness that behaves in a similar
manner to production.

This patch addresses the problem by centralizing all of the database
initialization into a single module class method named
PuppetLabs::Webhook.setup_environment. Each of the rake environment,
the spec helper, and the application itself all call this method and do
so in a single place.

In addition, the RACK_ENV=test environment is specifically configured to
use an in-memory sqlite3 database which should make the spec tests
functional and portable.

Finally, a commit is included to fix an unitialized constant error
inside of the IssueController class. This error prevents github issues
from being handled properly.