{"action":"created","issue":{"url":"https://api.github.com/repos/remyferre/octokit-issues/issues/7","labels_url":"https://api.github.com/repos/remyferre/octokit-issues/issues/7/labels{/name}","comments_url":"https://api.github.com/repos/remyferre/octokit-issues/issues/7/comments","events_url":"https://api.github.com/repos/remyferre/octokit-issues/issues/7/events","html_url":"https://github.com/remyferre/octokit-issues/issues/7","id":97718856,"number":7,"title":"How to stub octokit calls?","user":{"login":"remyferre","id":4510210,"avatar_url":"https://avatars.githubusercontent.com/u/4510210?v=3","gravatar_id":"","url":"https://api.github.com/users/remyferre","html_url":"https://github.com/remyferre","followers_url":"https://api.github.com/users/remyferre/followers","following_url":"https://api.github.com/users/remyferre/following{/other_user}","gists_url":"https://api.github.com/users/remyferre/gists{/gist_id}","starred_url":"https://api.github.com/users/remyferre/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/remyferre/subscriptions","organizations_url":"https://api.github.com/users/remyferre/orgs","repos_url":"https://api.github.com/users/remyferre/repos","events_url":"https://api.github.com/users/remyferre/events{/privacy}","received_events_url":"https://api.github.com/users/remyferre/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-07-28T14:23:54Z","updated_at":"2015-07-28T14:23:57Z","closed_at":null,"body":"<a href=https://github.com/bronson>  <img src=https://avatars.githubusercontent.com/u/1776?v=3 align=left width=48 height=48 hspace=10></img></a> **Issue by [bronson](https://github.com/bronson)**\n_26/03/2011 at 11:46PM_\n\n\n ---- \n\n\nI haven't found a good way to test Octokit usage in my app.  Closest I've come is this:\n\n    test = Octokit::Client.new :adapter => :test\n    test.user('bronson')\n     => RuntimeError: no stubbed request for get /api/v2/json/user/show/bronson\n\nLooks great so far.  I just haven't figured out how to stub that request.  I've tried all sorts of variations mentioned in Faraday's readme, nothing's worked.\n\nIs there a good way to test Octokit calls in my app?"},"comment":{"url":"https://api.github.com/repos/remyferre/octokit-issues/issues/comments/125626061","html_url":"https://github.com/remyferre/octokit-issues/issues/7#issuecomment-125626061","issue_url":"https://api.github.com/repos/remyferre/octokit-issues/issues/7","id":125626061,"user":{"login":"remyferre","id":4510210,"avatar_url":"https://avatars.githubusercontent.com/u/4510210?v=3","gravatar_id":"","url":"https://api.github.com/users/remyferre","html_url":"https://github.com/remyferre","followers_url":"https://api.github.com/users/remyferre/followers","following_url":"https://api.github.com/users/remyferre/following{/other_user}","gists_url":"https://api.github.com/users/remyferre/gists{/gist_id}","starred_url":"https://api.github.com/users/remyferre/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/remyferre/subscriptions","organizations_url":"https://api.github.com/users/remyferre/orgs","repos_url":"https://api.github.com/users/remyferre/repos","events_url":"https://api.github.com/users/remyferre/events{/privacy}","received_events_url":"https://api.github.com/users/remyferre/received_events","type":"User","site_admin":false},"created_at":"2015-07-28T14:23:57Z","updated_at":"2015-07-28T14:23:57Z","body":"<a href=https://github.com/sferik>  <img src=https://avatars.githubusercontent.com/u/10308?v=3 align=left width=48 height=48 hspace=10></img></a> **Comment by [sferik](https://github.com/sferik)**\n_30/03/2011 at 02:58AM_\n\n\n ---- \n\n\nYou should be able to stub a request by doing something like this:\r\n\r\n    @conn = Faraday::Connection.new\r\n    @conn.builder.build do |b|\r\n      b.adapter :test do |stub|\r\n        stub.get '/' do |env|\r\n          [200, {:header => \"value\"}, \"body\"]\r\n        end\r\n      end\r\n    end"}}