Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Failures:
- 1) Recipe Chocolate Search
- Failure/Error: subject{ Recipe.for("chocolate") }
- WebMock::NetConnectNotAllowedError:
- 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'}
- You can stub this request with the following snippet:
- stub_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,i entity;q=0.3', 'User-Agent'=>'Ruby'}).
- to_return(:status => 200, :body => "", :headers => {})
- registered request stubs:
- stub_request(:get, "http://food2fork.com/api/search?fields=key&key=eb7cd567c9dfb90c8d4da5f8a7309b41&q=chocolate")
- ============================================================
- # /usr/local/rvm/gems/ruby-2.3.0/gems/webmock-2.0.3/lib/webmock/http_lib_adapters/net_http.rb:114:in `request'
- # /usr/local/rvm/gems/ruby-2.3.0/gems/httparty-0.13.7/lib/httparty/request.rb:117:in `perform'
- # /usr/local/rvm/gems/ruby-2.3.0/gems/httparty-0.13.7/lib/httparty.rb:545:in `perform_request'
- # /usr/local/rvm/gems/ruby-2.3.0/gems/httparty-0.13.7/lib/httparty.rb:476:in `get'
- # ./module3_1_assignment.rb:16:in `for'
- # ./spec/recipe_spec.rb:37:in `block (3 levels) in <top (required)>'
- # ./spec/recipe_spec.rb:39:in `block (3 levels) in <top (required)>'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement