Module: Jarvis::TestSupport
- Defined in:
- lib/jarvis/test_support/test_support.rb
Instance Method Summary collapse
- #parsed_response(response) ⇒ Object
- #slack_outgoing_message(options = {text:"Jarvis, what's going on?"}) ⇒ Object
- #stub_env(hash) ⇒ Object
Instance Method Details
#parsed_response(response) ⇒ Object
18 19 20 |
# File 'lib/jarvis/test_support/test_support.rb', line 18 def parsed_response(response) JSON.parse(response.body)["text"] end |
#slack_outgoing_message(options = {text:"Jarvis, what's going on?"}) ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/jarvis/test_support/test_support.rb', line 5 def (={text:"Jarvis, what's going on?"}) { "team_id" => [:team_id] || "T0001", "channel_id" => [:channel_id] || "BLAH", "channel_name" => [:channel_name] || "test", "timestamp" => [:timestamp] || "1355517523.000005", "user_id" => [:user_id] || "U2147483697", "user_name" => [:user_name] || "Steve", "text" => [:text], "trigger_word" => [:trigger_word] || "Jarvis" } end |
#stub_env(hash) ⇒ Object
22 23 24 |
# File 'lib/jarvis/test_support/test_support.rb', line 22 def stub_env(hash) stub_const('ENV', ENV.to_hash.merge(hash)) end |