Inline the `#endpoint` method in tests

1. It's much easier to read the tests, because we don't need to look for a
   method definition, and the method body is very small anyway.
2. We can't use this method in blocks, like in `#namespace` or `#resource`,
   so then we need to define it outside, and spend an extra line. And we
   can't easily define it in a before block.
Fix issues with nested namespaces

`#resource(s)`, `#redirect` and HTTP routes weren't working correctly
with nested namespaces.
Merge pull request #26 from janko-m/fix-nested-namespaces

Fix issues with nested namespaces