Acceptance tests

Fixes #315.
This assertion setup code is very similar to the one in previous test; probably we can make utility assertion function that covers both cases.