Converted middleware tests to use RequestFactory.

Good point, thanks. Changed it to use `quote` since we don't need to quote `/` etc.