{"push_id":742826116,"size":3,"distinct_size":1,"ref":"refs/heads/version-23-1-0","head":"245b86012ce5b0be4207e9c5da1a7fc1a99bdfa4","before":"bd8851f5265b37b7aae8f11bef0043762e96b888","commits":[{"sha":"a90d053d41c305e6b2f4b35c3207140b70ab47de","author":{"email":"eef16ec869f7c47862e858ad0bde918d09cef193@digital.cabinet-office.gov.uk","name":"David Heath"},"message":"Generalise request matching in PublishingApi assertions\n\nThe assertions provided by the PublishingApi test helpers are useful.\nThe existing implementation allows an assertion to require that a\nrequest was made to a publishing api endpoint with a hash containing a\ncertain list of required attributes.\n\nHowever the underlying matching process would only take into account the\noutermost level of the hash when performing the comparison. This means\nthat you could make an flexible assertion about the required elements at\nthe top level of a document sent to the publishing api, but if you\nwanted to make assertions about the details section or elements nested\nwithin the details section, you could only perform an exact match on the\ndetails hash.\n\nThis would lead to brittle, difficult to maintain tests.\n\nThis commit allows passing custom matcher predicates to the assertions\nand defines a new matcher which can match nested structures more\nloosely.\n\nThe original strict matching behaviour is retained as a default to avoid\npossible unintended side-effects on the test suites of other apps.\n\nWe considered making the looser behaviour the default, but after\nreviewing the usage of some other apps I had enough doubt about that I\nthought it would be better to be conservative and avoid changing the\ndefault matching behaviour.\n\nTo use the assertions with the looser matcher you can do the following:\n\n```\nassert_publishing_api_put_item(\n  base_path,\n  request_json_including(details: {title: \"My title\"})\n)\n```\n\nNote that both matchers will convert symbols to strings so the\nhash can use either symbol or string keys.","distinct":false,"url":"https://api.github.com/repos/alphagov/gds-api-adapters/commits/a90d053d41c305e6b2f4b35c3207140b70ab47de"},{"sha":"64530f9368df353ea889ec064a17d81c92529103","author":{"email":"58cda7fab72e315083a7ecdf368192a81767adde@gmail.com","name":"Elliot Crosby-McCullough"},"message":"Merge pull request #337 from alphagov/generalise-publishing-api-assertion-matchers\n\nGeneralise request matching in PublishingApi assertions","distinct":false,"url":"https://api.github.com/repos/alphagov/gds-api-adapters/commits/64530f9368df353ea889ec064a17d81c92529103"},{"sha":"245b86012ce5b0be4207e9c5da1a7fc1a99bdfa4","author":{"email":"eef16ec869f7c47862e858ad0bde918d09cef193@digital.cabinet-office.gov.uk","name":"David Heath"},"message":"Bump version to 23.1.0","distinct":true,"url":"https://api.github.com/repos/alphagov/gds-api-adapters/commits/245b86012ce5b0be4207e9c5da1a7fc1a99bdfa4"}]}