19 Oct '13, 2pm

How to stub external services in tests

$ rspec spec/features/external_request_spec.rb F Failures: 1) External request queries FactoryGirl contributors on Github Failure/Error: response = Net::HTTP.get(uri) WebMock::NetConnectNotAllowedError: Real HTTP connections are disabled. Unregistered request: GET https://api.github.com/repos/thoughtbot/factory_girl/contributors with headers {'Accept'=>'*/*', 'Accept-Encoding'=>'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Host'=>'api.github.com', 'User-Agent'=>'Ruby'} You can stub this request with the following snippet: stub_request(:get, "https://api.github.com/repos/thoughtbot/factory_girl/contributors"). with(:headers => {'Accept'=>'*/*', 'Accept-Encoding'=>'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Host'=>'api.github.com', 'User-Agent'=>'Ruby'}). to_return(:status => 200, :body => "", :headers => {}) ============================================================ # ./spe...

Full article: http://robots.thoughtbot.com/post/64474832169/how-to-stub...

Tweets

How To Stub External Services In Tests

robots.thoughtbot.com 26 Oct '13, 6am

$ rspec spec/features/external_request_spec.rb F Failures: 1) External request queries FactoryGirl contributors on Github ...

20 Rubyists using Sinatra

rubylearning.com 21 Oct '13, 1am

I’ve just founded a company called “Rock & Code ” in Amsterdam, The Netherlands that offers solutions developed on Sinatra...

Requests to external services during tes...

rubyflow.com 31 Oct '13, 6pm

Requests to external services during test runs can cause several issues: * Tests failing intermittently due to connectivit...

standalone sinatra jar with jruby #ruby #ror #R...

blog.evanweaver.com 18 Oct '13, 3pm

For Fauna , we needed to migrate the website (a Sinatra app) from Heroku to our own servers in AWS us-west-2 . I wanted to...

Crowdcurity brings crowdsourced hacker testing to bitcoin

Crowdcurity brings crowdsourced hacker testing ...

coindesk.com 16 Oct '13, 10am

Bitcoin websites are prime targets for cyber-attacks. Now, a company called Crowdcurity wants to apply the wisdom of crowd...

Sinatra using respond_to with url extensions (....

rubyflow.com 09 Oct '13, 4pm

Sinatra using respond_to with url extensions (.json) Posted by danmayer on October 09, 2013 — 0 comments I had some issues...

Unit vs Integration vs Functional tests in #rails

weblog.jamisbuck.org 20 Oct '13, 2am

Unit tests. Functional tests. Integration tests. Rails draws a lot of circles around your tests, and it does a good job (i...

@aBritishLad Harvey Norman in BPP(?) Annd, I th...

harveynorman.com.sg 19 Oct '13, 12pm

Harvey Norman Singapore offers a range of external hard drives and portable storage solutions for your desktop and mobile ...

27th October - Changes to Darlington services 5...

arrivabus.co.uk 19 Oct '13, 9am

Changes to Bus Services around Darlington - 27th October 2013 From 27th October there will be changes to Darlington servic...