alphagov/collections — pull request #50 by bradleywright (2014-10-23 08:47:16+00:00)
Title: Correct email-alert-api data access

The type of data that [gds-api-adapters](https://github.com/alphagov/gds-api-adapters) returns is an [`OpenStruct`-like object](https://github.com/alphagov/gds-api-adapters/blob/534e9671ca2aa9e159a5b29176d1268067fbe0c2/lib/gds_api/response.rb#L77-L79) rather than a hash.

Additionally, the expected response is actually nested inside a `subscriber_list` top-level JSON structure.

This commit updates the model to look for methods instead of keys, and changes the tests to use `OpenStructs` everywhere.

I'm aware this is pretty quick and dirty - ideally we'd use the test helpers provided by `gds-api-adapters` instead of this, but I need a quick release as this is blocking a bunch of other things.