janko / rodauth-rails

Rails integration for Rodauth authentication framework
https://github.com/jeremyevans/rodauth
MIT License
571 stars 40 forks source link

set_title when calling #view, like in rodauth #113

Closed HoneyryderChuck closed 2 years ago

HoneyryderChuck commented 2 years ago

Closes #112

HoneyryderChuck commented 2 years ago

@janko added a test. I didn't find a way to "dynamically" set rodauth configuration before the test, so I went with creating a separate test app instead. Let me know if this works for you.

janko commented 2 years ago

@HoneyryderChuck I was thinking we could just set it on RodauthMain, and then tests exercising RodauthMain will already test rendering without title_instance_variable being set. That way we still exercise both paths, without adding a new Rodauth configuration.

HoneyryderChuck commented 2 years ago

But if we set in on main, then the default will be overwritten all the time, so you won't test the "no variable set" path. Is that acceptable?

janko commented 2 years ago

It will be set for main, but not admin, as far as I could tell. So, we should be able to test the unset instance variable by visiting an admin route, unless I'm missing something.

HoneyryderChuck commented 2 years ago

@janko done, let me know if this works out.

janko commented 2 years ago

Looks great, thanks for updating 👍🏻