support setting content_type of resonse
wireframe opened this issue · 3 comments
wireframe commented
I'd like to stub out a response to an image file and have the FakeWeb response return 'image/jpeg' as the content type.
i'd like it to work something like this:
FakeWeb.register_uri(:get, 'http://mysite.com/image.jpeg', :file => fixture_path + '/files/image.jpeg', :content_type => 'image/jpeg')
chrisk commented
Sounds like a good idea. I've just been using a full stored response with a Content-Type header, but that's a pain when you want to return a quick json response (or use binary, like your 'image/jpeg').
Anybody have a patch w/ tests for this?
dmichael commented
I have the patch for this. With a test. How would you like it? I could push to the repo...