Skip to content

Instantly share code, notes, and snippets.

@jorgemanrubia
Created May 18, 2011 00:46
Show Gist options
  • Save jorgemanrubia/977786 to your computer and use it in GitHub Desktop.
Save jorgemanrubia/977786 to your computer and use it in GitHub Desktop.
Definition of helper methods for simulating requests with raw content (raw_post parameter) (RSpec)
# Methods like "put_raw" will put the raw content in the request
[:put, :post].each do |verb|
define_method "#{verb}_raw" do |method, content|
request.stub!(:raw_post).and_return(content)
put method
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment