1

Good morning, I have a question. How i can reload my routes into a RSpec Test after change my env variable like i do in rails (Rails.application.reload_routes!) Thank you! Gustavo

  • What's your env var controlling? Do you have a snippet to share? – Luca Guidi Jan 15 '19 at 21:12
  • No i dont have, but all i want to know is how i reload my routes with hanami like i do in rails – Gustavo Ziaugra Jan 16 '19 at 10:59
  • There is no way to reload routes in Hanami. But why do you need it? I'm sure there is another way to achieve what you're looking for. – Luca Guidi Jan 17 '19 at 18:36
  • Because i did a if conditional into my routes like this example: `namespace 'mock' do get '/foo', to: 'foo#bar', as: :foo_bar get '/bar', to: 'bar#foo', as: :bar_food end if AplicationName.settings.Aplication_env == 'development' ` And i expect to not found some routes into my production env Soo to test my enviroments i need change my AplicationName.settings.Aplication_env and reload my routes to see if they are routable into RSpec – Gustavo Ziaugra Jan 18 '19 at 18:29
  • What's the object under test? `Web.routes`? – Luca Guidi Jan 25 '19 at 12:57
  • Yes, that`s the object. – Gustavo Ziaugra Jan 29 '19 at 11:16

0 Answers0