Using `Discourse.XYZ` in templates is deprecated. This fixes that, plus
adds some more integration tests to make sure login required is working.