alphagov/gds-api-adapters — pull request #181 by kalleth (2014-07-25 10:05:37+00:00)
Title: Add AAIB and IDF schemas to TestHelpers::FinderApi

Previously, the finder_api_has_schema method would either default to using its internal CMA case schema (which was outdated) or allow a schema to be passed in.

Now we're dealing with more than just CMA cases, we needed to use schemas of different types, and rather than force consumers to store the schemas themselves and pass them up, I decided to store them in the (already extant) fixtures dir within gds-api-adapters.

Potentially I could modify this approach to use dependency injection to inject a factory which is then used to generate the desired schema (which defaults to 'via slug inspection and local fixtures', but could then be overridden by child classes) -- but I think that would unnecessarily overcomplicate things. Input welcome.