Skip to content

Unregistered request during test : thread_settings #38

Description

@luizcarvalho

I clone the project and when I run rspec, this happens:

Verify the bot with the following verify_token :github
/home/luiz/.rvm/gems/ruby-2.3.3/gems/webmock-2.3.1/lib/webmock/http_lib_adapters/net_http.rb:114:in `request': Real HTTP connections are disabled. Unregistered request: POST https://graph.facebook.com/v2.6/me/thread_settings?access_token= with body '{"setting_type":"call_to_actions","thread_state":"existing_thread","call_to_actions":[{"type":"postback","title":"Reset","payload":"RESET_BOT"},{"type":"postback","title":"Info","payload":"INFO_BOT"}]}' with headers {'Content-Type'=>'application/json'} (WebMock::NetConnectNotAllowedError)

You can stub this request with the following snippet:

stub_request(:post, "https://graph.facebook.com/v2.6/me/thread_settings?access_token=").
  with(:body => "{\"setting_type\":\"call_to_actions\",\"thread_state\":\"existing_thread\",\"call_to_actions\":[{\"type\":\"postback\",\"title\":\"Reset\",\"payload\":\"RESET_BOT\"},{\"type\":\"postback\",\"title\":\"Info\",\"payload\":\"INFO_BOT\"}]}",
       :headers => {'Content-Type'=>'application/json'}).
  to_return(:status => 200, :body => "", :headers => {})
  • Rails 4.2.6
  • ruby 2.3.3p222 (2016-11-21 revision 56859) [x86_64-linux]

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions