Octokit responses are of type Sawyer::Response
They look like this:
{:name=>"code.py",
:content => "some content"}
I am trying to stub my request like so
reponse_body = {:content => "some content"}
stub_request(:any, /.*api.github.com\/repos\/my_repo\/(.*)\/code.py/).to_return(:status => 200, :body => response_body)
In my code I then call response.content, so I want to be able to get the content from the response.
I currently get the error: 'WebMock::Response::InvalidBody: must be one of: [Proc, IO, Pathname, String, Array]. 'Hash' given'. What is the proper format for response_body? If I turn it into a json, I then can't do response.content on the object in my code.
WebMock::Response::InvalidBody: must be one of: [Proc, IO, Pathname, String, Array].'RSpec::Mocks::Double' given
– Sports