Fixed acceptance test.

Wrong parameter in a function call, and reorganization of test setup so that as much work as possible is done in the "before :each" stage, rather than in the tests themselves.