graphiti-api / graphiti-rails

MIT License
53 stars 28 forks source link

Specs fail because an rspec double is leaking across tests #105

Open jasonkarns opened 1 year ago

jasonkarns commented 1 year ago

The Rails.logger double (via as_null_object) is leaking across tests. It is pulled from ::Rails and set as ::Graphiti.logger which, as a constant, persists across specs.

This resets Graphiti's config after the railtie specs which stub on it.

Also, the railtie test can't run without configuring rspec (via some helpers) and loading the Railtie under test. Ideally we'd use a slimmed-down spec_helper for configuring just rspec (without rails). However, that doesn't already exist, and we'd need some form of autoloading anyway; so for the time being we just use the existing rails_helper.