Advertisement
Guest User

Untitled

a guest
May 28th, 2016
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.64 KB | None | 0 0
  1. Failures:
  2.  
  3. 1) Recipe Chocolate Search
  4. Failure/Error: subject{ Recipe.for("chocolate") }
  5.  
  6. WebMock::NetConnectNotAllowedError:
  7. Real HTTP connections are disabled. Unregistered request: GET http://food2fork.com/api?fields=key&key=eb7cd567c9dfb90c8d4da5f8a7309b41&q=search&query=chocolate with headers {'Accept'=>'*/*', 'Accept-Encoding'=>'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'User-Agent'=>'Ruby'}
  8.  
  9. You can stub this request with the following snippet:
  10.  
  11. stub_request(:get, "http://food2fork.com/api?fields=key&key=eb7cd567c9dfb90c8d4da5f8a7309b41&q=search&query=chocolate").
  12. with(:headers => {'Accept'=>'*/*', 'Accept-Encoding'=>'gzip;q=1.0,deflate;q=0.6,i entity;q=0.3', 'User-Agent'=>'Ruby'}).
  13. to_return(:status => 200, :body => "", :headers => {})
  14.  
  15. registered request stubs:
  16.  
  17. stub_request(:get, "http://food2fork.com/api/search?fields=key&key=eb7cd567c9dfb90c8d4da5f8a7309b41&q=chocolate")
  18.  
  19. ============================================================
  20. # /usr/local/rvm/gems/ruby-2.3.0/gems/webmock-2.0.3/lib/webmock/http_lib_adapters/net_http.rb:114:in `request'
  21. # /usr/local/rvm/gems/ruby-2.3.0/gems/httparty-0.13.7/lib/httparty/request.rb:117:in `perform'
  22. # /usr/local/rvm/gems/ruby-2.3.0/gems/httparty-0.13.7/lib/httparty.rb:545:in `perform_request'
  23. # /usr/local/rvm/gems/ruby-2.3.0/gems/httparty-0.13.7/lib/httparty.rb:476:in `get'
  24. # ./module3_1_assignment.rb:16:in `for'
  25. # ./spec/recipe_spec.rb:37:in `block (3 levels) in <top (required)>'
  26. # ./spec/recipe_spec.rb:39:in `block (3 levels) in <top (required)>'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement