How to set values for config’s of my Handler in tests?

Asked

Viewed 14 times

0

My Handler has 4 configuration variables:

  config :base_url
  config :details_path
  config :create_path
  config :token

I know them and my lita_config file, but to test my Handler, I need to set values for them in my specs too, as I can do this?

2 answers

0

0


In rspec for the set of settings set for a Lita Handler can be done using registry. For example, in my case, my Handler calls dpeauth, to set these 3 configuration variables we can do so:

registry.config.handlers.dpeauth.base_url = 'valor'
registry.config.handlers.dpeauth.details_path = 'valor'
registry.config.handlers.dpeauth.create_path = 'valor'
registry.config.handlers.dpeauth.token = 'valor'

Browser other questions tagged

You are not signed in. Login or sign up in order to post.